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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A10BC433EF for ; Fri, 4 Mar 2022 18:29:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237849AbiCDSaR (ORCPT ); Fri, 4 Mar 2022 13:30:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241692AbiCDSaL (ORCPT ); Fri, 4 Mar 2022 13:30:11 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08221470C7 for ; Fri, 4 Mar 2022 10:29:23 -0800 (PST) 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 DF1AA21124; Fri, 4 Mar 2022 18:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646418561; 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=pN3nycF2X6fHWfqQuX6WHc3ZTvBGGIZogfQbyTU9TQY=; b=JS8mNsZlZzebTZBrKrjP2ORPoEh4qRDNGWEXsJms7ABTQoo9OSPWXSFXVpqJ40ll438Bfm mMM3m7BQAd+lEBzo/IWV3dqyucr3ypAp9dlrR2tS+Wz/dvYPB5lQf0ykyRVxVQECcmiqPm BG9gP8wb+mJkphZGA3D+Xlykso64yb0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646418561; 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=pN3nycF2X6fHWfqQuX6WHc3ZTvBGGIZogfQbyTU9TQY=; b=+XnwmCPfRIxYQks5Mt/fAUOkUf/w3L2B2pqtJM4o90jAYpm4rbPFQxLb9y3hjEO2xQ9fN5 JaIBpv1FlR/Z9FDw== 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 B21B713B70; Fri, 4 Mar 2022 18:29:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PjvHKoFaImJjAwAAMHmgww (envelope-from ); Fri, 04 Mar 2022 18:29:21 +0000 Message-ID: Date: Fri, 4 Mar 2022 19:29:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2 3/5] mm/sl[auo]b: move definition of __ksize() to mm/slab.h Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Marco Elver , Matthew WilCox , Roman Gushchin , linux-kernel@vger.kernel.org References: <20220304063427.372145-1-42.hyeyoo@gmail.com> <20220304063427.372145-4-42.hyeyoo@gmail.com> From: Vlastimil Babka In-Reply-To: <20220304063427.372145-4-42.hyeyoo@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/4/22 07:34, Hyeonggon Yoo wrote: > __ksize() is only called by KASAN. Remove export symbol and move > definition to mm/slab.h as we don't want to grow its callers. > > [ willy@infradead.org: Move definition to mm/slab.h and reduce comments ] > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka > --- a/mm/slab.h > +++ b/mm/slab.h > @@ -685,6 +685,8 @@ static inline void free_large_kmalloc(struct folio *folio, void *object) > } > #endif /* CONFIG_SLOB */ > > +size_t __ksize(const void *objp); > + > static inline size_t slab_ksize(const struct kmem_cache *s) > { > #ifndef CONFIG_SLUB > diff --git a/mm/slab_common.c b/mm/slab_common.c > index 1d2f92e871d2..b126fc7247b9 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -1247,13 +1247,7 @@ EXPORT_SYMBOL(kfree_sensitive); > > #ifndef CONFIG_SLOB > /** Maybe just /* so it's not even parsed as a kernel-doc anymore? > - * __ksize -- Uninstrumented ksize. > - * @objp: pointer to the object > - * > - * Unlike ksize(), __ksize() is uninstrumented, and does not provide the same > - * safety checks as ksize() with KASAN instrumentation enabled. > - * > - * Return: size of the actual memory used by @objp in bytes > + * __ksize -- Uninstrumented ksize. Only called by KASAN. > */ > size_t __ksize(const void *object) > { > @@ -1269,7 +1263,6 @@ size_t __ksize(const void *object) > > return slab_ksize(folio_slab(folio)->slab_cache); > } > -EXPORT_SYMBOL(__ksize); > #endif >