Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp345038imn; Fri, 29 Jul 2022 08:35:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBTFdFLa1QNp8Fh1nAvLjSQQnQ/fRFjmat8XvJWtk51YLaAbe9p0mk4SZbc27NiQuCRpM0 X-Received: by 2002:a17:907:9482:b0:72b:8c16:dac0 with SMTP id dm2-20020a170907948200b0072b8c16dac0mr3216036ejc.286.1659108911365; Fri, 29 Jul 2022 08:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659108911; cv=none; d=google.com; s=arc-20160816; b=fhSDSTeYIAB8GbSgyamwVZ3jl5gB19gDLvqTHPA+f3x6XUMc/hRhXD+oCss5i3T8Sb IT58t4z++h564dx+D7T267KHT9SXehgOfaCzjCPDfjdxC+uG4jaIa7PZyvzyWdqmODKP W7h4XNNK8Wvx1VbEJTOVBC4l/IviEUBl5hIDZQRmQ9x+TUFCJhYvaQrub31RF4Gkc4dM MIIX2OWvIMTumx4Ho3zS16ct14F6XaUhJeTsaz8zsYeFwn+pVevaPIKkVc8wa2ocmdmX DHgfGvZFwoJKKHGESFDCm/MyQ4bThxhMmCS+9xx5850SIPdXiRkPt4rEzuiF2W4NuPuq VdIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=7cHPQIB6zQDwcGtL276NpmzoSPq4JV+FEJd0yazhehc=; b=A219kzuGWQmLzorNuyZcoitL3u8lLJK45AEGLO+cnILlAHAsUxW/EWYnniq6fV6sd4 gqIhCyZHoSX8eovh1KbVyiUzZ3zOZQKy4fdZSThD3EWol+y+pGN8lCH6pfiAYnKT4s/A W3yjovZ4nE6eS6zLEDU+/7HJXQemMI/udQcPawKr5h/w4XLJe2cif8NvoFCCHIZBsRsJ M9AB7tZmhAh4DoAn/WqfRmE2LUQvmIuw12qgwkNYF04uab0frjOJCCUpFsyIJucfPnpV Bn02HwIlLm5e6gqC1SKe21fedEvZQ33x8OuQRS0W/QN1MAESNHbcNx86xBh+j/NZ5yRc 9bKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qxg01MO2; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d26-20020a170906175a00b00726b8cf8debsi3182273eje.869.2022.07.29.08.34.46; Fri, 29 Jul 2022 08:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qxg01MO2; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236918AbiG2PIg (ORCPT + 99 others); Fri, 29 Jul 2022 11:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233738AbiG2PIe (ORCPT ); Fri, 29 Jul 2022 11:08:34 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74A0980F5E for ; Fri, 29 Jul 2022 08:08:33 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2D83834179; Fri, 29 Jul 2022 15:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659107312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cHPQIB6zQDwcGtL276NpmzoSPq4JV+FEJd0yazhehc=; b=qxg01MO2yHUbuFhuXC8GxKwY03/nprCcVK+16yZnJawMOw4ADuMmgylbIT5ipEOFaYj68l ajxnl3gF8eytDOv29Bg18pUXEJcNNRbOwy9DENMSYug+51Gkk2xxwi2sI8nbDloR6kVLsC jP2o1Zy/oKOHBL8Gi86RZ6MKmk0hbx4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659107312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cHPQIB6zQDwcGtL276NpmzoSPq4JV+FEJd0yazhehc=; b=UcQg6MB8qBcg7vTB/xVsUq9+KkBIhY4RGdXAr6P/TNOhdu5Gpsr/ce1E2JoQHoPqR5/WYY INdAwjURNsrnMyAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F2BB213A1B; Fri, 29 Jul 2022 15:08:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id I2iQOu/342ICdQAAMHmgww (envelope-from ); Fri, 29 Jul 2022 15:08:31 +0000 Message-ID: Date: Fri, 29 Jul 2022 17:08:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 00/15] common kmalloc v3 Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Joe Perches , Vasily Averin , Matthew WilCox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20220712133946.307181-1-42.hyeyoo@gmail.com> From: Vlastimil Babka In-Reply-To: <20220712133946.307181-1-42.hyeyoo@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/22 15:39, Hyeonggon Yoo wrote: > This is v3 of common kmalloc series. > > This series generalize most of kmalloc functions and move its > implementation into mm/slab_common.c. > > I believe this series give better maintainability of code for SLAB and SLUB. > Please consider applying. > > This series is based on slab/for-next and also available at > https://github.com/hygoni/linux/tree/slab-common-v3r0 > > Any feedbacks/reviews will be appreciated. Hi, thanks for all your efforts. It's shaping up nicely so I think the next version will be ready to be added to -next after the 5.20 merge window. As I've finished the individual reviews, I'm looking at the result and see a bit more potential for cleanups, which could be perhaps incorporated to existing patches, or additionally: - kmalloc_large_node_notrace() has only one caller, can be removed and the caller can call __kmalloc_large_node_notrace() directly, especially if it's not __always_inline as I've IIRC suggested. - kmem_cache_alloc_trace() and kmem_cache_alloc_node_trace() are weird ones, they are in fact for kmalloc despite the name. They depend on CONFIG_TRACING, yet if you look carefully, the !CONFIG_TRACING variant also goes through a trace_* function. The actual difference seems that slab_alloc() thus kasan_alloc() and kfence_alloc() don't get the orig_size that way, which is dubious. It might be worth trying to unify this as well? E.g. - use only the CONFIG_TRACING variant, discard the other - declare it in mm/slab.h, this is not for general usage - single implementation in mm/slab_common.c that calls __kmem_cache_alloc_node() from SLAB/SLUB and does the trace