Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2793057rwb; Mon, 5 Sep 2022 01:17:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OCG6dTOUt6cZN71rv3zF97gDvDusickFDzPRoMMTUwV0cHUo5biXZP3gmZAnOIPPikC9K X-Received: by 2002:a05:6402:1cc4:b0:440:5af8:41c9 with SMTP id ds4-20020a0564021cc400b004405af841c9mr42164496edb.339.1662365861124; Mon, 05 Sep 2022 01:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662365861; cv=none; d=google.com; s=arc-20160816; b=RxMQg8YB3o3Xj+7TfX+v41UVuGee5Zgy4kwc8b0m+nWFhmjJepqgeryO153NqrnQ0B CPqYBiEqbFy2Bnp69pSWWeTUrUn0ovdPTRK7eZLq9/Yhm94MdebDZdctU6hNL/tumxro sDiEcTCuEKF9KRwU8fuXcdQu1kyaUI4pEcbX/c8vIlHY6LXsYVgSAErn923gLX77qBB4 XnBN7LOgl7vMWa0uPk7zt9dfcHx/bhLoP7Ep62s4eABFjBKlPsttzqDy/jii8VIisrA5 l53Ro6x0vZqpmxbUbliD34Bp48Zo1wbriglaZnNUVaiEUUV/Wzhh4iQ6RAYfUOOkHW8k 4xWw== 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=39bgkAvs9u3id1sAAJvSO5eKLLioMenaUUj0S5kesmo=; b=A0iKPXNmMd51rHd0Gs5MBaoAjOqXFfWPAGUxHhtXEo/JeiG4AcfelQ6dXGmkWa/txy KwFFwInM2HPXAlKyB83ZX6yQ05AktRS8G5mYmPJCWO68j/Cx/ZAeMAFxiwJ+runulNLO QbHp1kvfDskk5R5gODgJzSqj8IRd1hEaRqzqGOyH+FeHmmaveyBn9rbO4+KFFEGFRMJX vGHTjvQtG16MgtE7ae6WgRx3LE4LpNnjZ99mMIrSOCSi2tFa7jAzlly4r96gcIZs6cPi MPafWMNNWIklYL7YcYN+3WSaZ6ltEaIS3oPB6RNDmeM35UysnbOKvnQeejHpc+0+Blqq 1eAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=MvNrGdBd; 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 mp36-20020a1709071b2400b007419f6dfba2si7139946ejc.41.2022.09.05.01.17.16; Mon, 05 Sep 2022 01:17:41 -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=MvNrGdBd; 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 S234960AbiIEHdV (ORCPT + 99 others); Mon, 5 Sep 2022 03:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234585AbiIEHdT (ORCPT ); Mon, 5 Sep 2022 03:33:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A60711183D for ; Mon, 5 Sep 2022 00:33:16 -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 C962238779; Mon, 5 Sep 2022 07:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1662363194; 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=39bgkAvs9u3id1sAAJvSO5eKLLioMenaUUj0S5kesmo=; b=MvNrGdBdgkHVGCownMmnvspVKGc7or3wuKuZUQFzAnte2gJ7ZGqL2ZXmohsnYwCxMkKgJ+ hnKS2oFWl8zp+cqfCQ5NO3vpm3AIGz4qU0fplToAS5cXbH1x1OcRoeOIIYx+mxjydfHZRp oBhwxztL6DGcqbz17tQqr8RXHiiUBFk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1662363194; 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=39bgkAvs9u3id1sAAJvSO5eKLLioMenaUUj0S5kesmo=; b=2PBBExInd9LrA1vZbCEQnlAsHffcz2XQJ8zQA4rZyAtgIFNSjk6KncAuDOOU4ouz2RtQEu XUNZpnks5IbxWJBw== 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 90BAB13A66; Mon, 5 Sep 2022 07:33:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id V5OZIjqmFWMCcQAAMHmgww (envelope-from ); Mon, 05 Sep 2022 07:33:14 +0000 Message-ID: Date: Mon, 5 Sep 2022 09:33:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v4 1/4] mm/slub: enable debugging memory wasting of kmalloc Content-Language: en-US To: Feng Tang Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Dmitry Vyukov , "Hansen, Dave" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Robin Murphy , John Garry , Kefeng Wang References: <20220829075618.69069-1-feng.tang@intel.com> <20220829075618.69069-2-feng.tang@intel.com> <8ff805f4-76ae-fc0f-424f-4d230c08285e@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 9/5/22 09:06, Feng Tang wrote: > On Mon, Sep 05, 2022 at 02:29:51PM +0800, Vlastimil Babka wrote: >> >> How about get_partial() instantiates an on-stack structure that contains >> gfpflags, ret_slab, orig_size and passes pointer to that to all the nested >> functions. >> >> Would be similar to "struct alloc_context" in page allocation. >> Something like "struct partial_context pc"? > > Yep! This would make the parameters passing much tidier. Will try > this way. > > More aggressively is to also embed the 'kmem_cache' parameter into > it, but this may make the code look ambiguous. That one is used a lot everywhere, so it would be tedious to dereference it from a struct, and also might be a bit better code if it's in a register. > Thanks, > Feng > >