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 80E91C433EF for ; Thu, 24 Mar 2022 17:46:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D98016B0071; Thu, 24 Mar 2022 13:46:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D475D6B0073; Thu, 24 Mar 2022 13:46:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE9366B0074; Thu, 24 Mar 2022 13:46:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id AFA0F6B0071 for ; Thu, 24 Mar 2022 13:46:36 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 90A9962331 for ; Thu, 24 Mar 2022 17:46:36 +0000 (UTC) X-FDA: 79280009592.09.FDC665C Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf16.hostedemail.com (Postfix) with ESMTP id DDD1118002D for ; Thu, 24 Mar 2022 17:46:35 +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 C36C6210FD; Thu, 24 Mar 2022 17:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648143994; 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=6nXfRRkwI9pT0Egb62KVCQmh30ZwxB4Oif8GwM6IzOI=; b=1xY/vL7oKZJ+V+m8eO34xNsjEY+2nmP4fLYXPTjyZO5igZctxEsQthD6YKhOoQ3h1rUeX0 1zZDjtdUv3hBxsdzuenuKtLvcw+LPtlhLUhhI7vLMkkUeeo/dNs9r8hOHV0c5QE8SzG84F UpWWwitpMlnwJIJccgHs/Js7txlccFo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648143994; 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=6nXfRRkwI9pT0Egb62KVCQmh30ZwxB4Oif8GwM6IzOI=; b=NIdmExCsToRsefI4UqAAIkxFSFt8oQw61dY77oFrCiMiWbtMf827G30ATuFseMm/EksI4t if+twqt1wnpWsCCg== 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 9BF0F13A7F; Thu, 24 Mar 2022 17:46:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xoteJXquPGKhYgAAMHmgww (envelope-from ); Thu, 24 Mar 2022 17:46:34 +0000 Message-ID: Date: Thu, 24 Mar 2022 18:46:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v1 08/15] mm/sl[auo]b: cleanup kmalloc() 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: <20220308114142.1744229-1-42.hyeyoo@gmail.com> <20220308114142.1744229-9-42.hyeyoo@gmail.com> From: Vlastimil Babka In-Reply-To: <20220308114142.1744229-9-42.hyeyoo@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="1xY/vL7o"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=NIdmExCs; spf=pass (imf16.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: DDD1118002D X-Stat-Signature: fm5f6hc87pt8b3esnyu4ujkjte998wxp X-HE-Tag: 1648143995-29853 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 3/8/22 12:41, Hyeonggon Yoo wrote: > Now that kmalloc() and kmalloc_node() do same job, make kmalloc() > wrapper of kmalloc_node(). > > Remove kmalloc_trace() that is now unused. This patch makes slab > allocator use kmalloc_node tracepoints in kmalloc(). > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Actually there are more things to fix than the commit log. > +#ifndef CONFIG_SLOB > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node) > +{ > + if (__builtin_constant_p(size)) { > + unsigned int index; > + > + if (size > KMALLOC_MAX_CACHE_SIZE) > + return kmalloc_large(size, flags); Should use kmalloc_large_node(). > + > + index = kmalloc_index(size); > + > + if (!index) > + return ZERO_SIZE_PTR; > + > + return kmem_cache_alloc_node_trace( > + kmalloc_caches[kmalloc_type(flags)][index], > + flags, node, size); > + } > + return __kmalloc_node(size, flags, node); > +} > +#else > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node) > +{ > + if (__builtin_constant_p(size) && size > KMALLOC_MAX_CACHE_SIZE) > + return kmalloc_large(size, flags); And here. > + > + return __kmalloc_node(size, flags, node); > +} > +#endif