From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EA19C19F2A for ; Mon, 1 Aug 2022 13:36:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C410F8E0001; Mon, 1 Aug 2022 09:36:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C170B6B0072; Mon, 1 Aug 2022 09:36:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADFD98E0001; Mon, 1 Aug 2022 09:36:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9E5276B0071 for ; Mon, 1 Aug 2022 09:36:51 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 63321120B14 for ; Mon, 1 Aug 2022 13:36:51 +0000 (UTC) X-FDA: 79751124222.14.643C4C2 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf29.hostedemail.com (Postfix) with ESMTP id C435F1200E7 for ; Mon, 1 Aug 2022 13:36:50 +0000 (UTC) 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 49AAD387DC; Mon, 1 Aug 2022 13:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659361009; 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=48frINV5ScZh/Ic/JwZ64qBIXxEjcd8Ch3oF0V+HeiA=; b=wnZ2AZ5/okL/EZgAZRAZGRvTT8g9N6qRxj7CsJDb1vTDzSAcmfhySaYWvVLqq+ECMrZYgB v2tiJ4FnVFRuvFyJV/UerOTdJy9+XdPQ1XhO2myKz5Fr+aRoFdng5hGLS3jUX08kV9436M HHz+glK6Rl6kcF1EZO+akypGNcZNBI8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659361009; 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=48frINV5ScZh/Ic/JwZ64qBIXxEjcd8Ch3oF0V+HeiA=; b=oRR/ahRvuXNqsao6OYkoXeWQP7hbSxdpdJk5jRc0HEHuRtxa6v7fOqXxpBw0Nc7az2MsCb dLvMfIXAurO85oBA== 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 1B77913A72; Mon, 1 Aug 2022 13:36:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JgsDBvHW52LdQAAAMHmgww (envelope-from ); Mon, 01 Aug 2022 13:36:49 +0000 Message-ID: <0ca2f22a-8247-8419-3f99-4456a4c7344a@suse.cz> Date: Mon, 1 Aug 2022 15:36:48 +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 06/15] mm/slab_common: fold kmalloc_order_trace() into kmalloc_large() Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Joe Perches , Vasily Averin , Matthew WilCox , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20220712133946.307181-1-42.hyeyoo@gmail.com> <20220712133946.307181-7-42.hyeyoo@gmail.com> <2e252179-0ffe-0d9c-9340-77e46f6ffdfd@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="wnZ2AZ5/"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="oRR/ahRv"; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659361011; a=rsa-sha256; cv=none; b=t5E/D/GPrPLcmd11GlhkcLFSfkJCHiSXJFA/T4oPArefO7S0wbv9GcwLYls1wWP2kJjYhI 9/N7pdKAmCx5E4kX+AmPONdbkSX8AWbzCGsD5pDI4Qs0Zdet42i8itqz8dgOfwQvcjjTAU HJci6C7hWkIW4o/2tU7stTN1vWwiH28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659361011; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=48frINV5ScZh/Ic/JwZ64qBIXxEjcd8Ch3oF0V+HeiA=; b=bb+Y0fMkHzRFF30xN85x2go4DVcsMS7ZhOzsxrbOu7105yKCsTzIhe9oRXnUSeW5JYhJny UraJjrfnFzH3ZdHhUE/YWzmzKOCFTIwxModzJzKm9Dx0Vv1rEKJiaY2FUztgr9k0B+TNR8 ymjl+xw3j5709/5fwqa9qcVtkQe1IQs= Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="wnZ2AZ5/"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="oRR/ahRv"; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: 9uoqkkbpkydw8td471wawh471ziurq6m X-Rspamd-Queue-Id: C435F1200E7 X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1659361010-938587 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 8/1/22 15:26, Hyeonggon Yoo wrote: > On Thu, Jul 28, 2022 at 05:23:29PM +0200, Vlastimil Babka wrote: >> On 7/12/22 15:39, Hyeonggon Yoo wrote: >> > There is no caller of kmalloc_order_trace() except kmalloc_large(). >> > Fold it into kmalloc_large() and remove kmalloc_order{,_trace}(). >> > >> > Also add tracepoint in kmalloc_large() that was previously >> > in kmalloc_order_trace(). >> > >> > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> >> > Reviewed-by: Vlastimil Babka >> > > Thank you for review. > >> Hmm noticed a small change in how we call trace_kmalloc() which will now >> include the __GFP_COMP. > > Good catch. > >> I think we could just call alloc_pages() from >> kmalloc_large() with flags | __GFP_COMP instead of doing flags |= >> __GFP_COMP; first. > > I'll consider that in next version. > >> AFAICS both kasan_kmalloc_large() and kmemleak_alloc() >> will filter it out anyway. > > AFAIK not passing __GFP_COMP to both kasan_kmalloc_large() > and kmemleak_alloc() will affect their behavior. You mean "will NOT affect...", right? > - kasan_kmalloc_large() only checks if flag has __GFP_DIRECT_RECLAIM, > - kmemleak_alloc() only use it to allocate kmemleak_object from > slab/pool, which does not require __GFP_COMP. > > simply calling > alloc_pages() with flags | GFP_COMP > kasan_kmalloc_large() with flags > kmemleak_alloc() with flags > trace_kmalloc() with flags > will be okay. > > BTW this is fixed after patch 9. Ah, right. __kmalloc_large_node_notrace() does the same flags |= __GFP_COMP; but the tracepoint is outside and unaffected.