From patchwork Tue Nov 16 00:16:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12620707 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 183D9C433FE for ; Tue, 16 Nov 2021 00:17:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BE10163215 for ; Tue, 16 Nov 2021 00:17:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE10163215 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 013616B0082; Mon, 15 Nov 2021 19:16:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 969F36B009D; Mon, 15 Nov 2021 19:16:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62F4F6B008C; Mon, 15 Nov 2021 19:16:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 924606B009A for ; Mon, 15 Nov 2021 19:16:42 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 464B882499B9 for ; Tue, 16 Nov 2021 00:16:42 +0000 (UTC) X-FDA: 78812877444.04.10AF0C8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf28.hostedemail.com (Postfix) with ESMTP id 44A2A90000B0 for ; Tue, 16 Nov 2021 00:16:41 +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-out2.suse.de (Postfix) with ESMTPS id 25EC61FD71; Tue, 16 Nov 2021 00:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637021800; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xEte6eqJBEFo85Aaud2Cb2kICDyOCG8iIMNk/bq0brI=; b=Hu6zJ4fPJGzO2259LDw+Ozy/1bi14WmsuNbWG4MoSk8mI2ik1cSErCP748OQ5zXdDSFqha 4MhTtivot8RQwzbrTY6XY2ystJkIPjSVU2Q2MQxX4RyqSihjHsBBw0C00qzXxD4oV4MeGp FXSFMH6p6KdZBy648W+Xhf5Rvplklhw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637021800; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xEte6eqJBEFo85Aaud2Cb2kICDyOCG8iIMNk/bq0brI=; b=35No3HzZYy1k2UXdKw3sTKasvFGaeLMfIlSpUHu/4miNjCxrQL7V9hV4H6f4C31hPQpbgL 661Kt8hrBdm7VSAQ== 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 08E9613F72; Tue, 16 Nov 2021 00:16:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IIKYAWj4kmFjXAAAMHmgww (envelope-from ); Tue, 16 Nov 2021 00:16:40 +0000 From: Vlastimil Babka To: Matthew Wilcox , linux-mm@kvack.org, Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: Vlastimil Babka Subject: [RFC PATCH 20/32] mm/slab: Finish struct page to struct slab conversion Date: Tue, 16 Nov 2021 01:16:16 +0100 Message-Id: <20211116001628.24216-21-vbabka@suse.cz> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211116001628.24216-1-vbabka@suse.cz> References: <20211116001628.24216-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2668; h=from:subject; bh=dgh29VnHmOZRGrWSkpzzNXpR2IbcJzJ44XMgWfFxj9c=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhkvhFA45KSKqJP9J2quqf7qgI8BlkswVg7DaEozY5 mBjiBbmJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYZL4RQAKCRDgIcpz8YmpEM2SB/ 9DLtR8oCG7SluUqnbOMStFvOs1b95JONckh4tsHONo6JGnjYUonuM6BgSRTeKN4evRFtvPFOEjXfYB 4UQ9Hb8O4CPMqsHlYGnH3QtKNcWvvSxzj132oWkDtK5GWvrIuGjtX5146pkTd33sFGGfli7rsNHi4X k3gQWvicXuCKAjJUPIsVYiEE2r84R4PoLkHXq9704e8WZBCpyg+B7W77kTJu6WS2BUAUnLzKHu4kP7 hRD56K4Abe+J4eVXuE8Jx6q4onul+F0cU+TaH4ss3TGf920/O4Qnaz1ZvXT3kPjRO2Y+53I1DzkFqf DA/CLHSD8tga4Zb2oM238c8XCqPstX X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 44A2A90000B0 X-Stat-Signature: pyrtpozyobo6io9rgf9d8zzxa87qnmin Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Hu6zJ4fP; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=35No3HzZ; spf=pass (imf28.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-HE-Tag: 1637021801-54899 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: Change cache_free_alien() to use slab_nid(virt_to_slab()). Otherwise just update of comments and some remaining variable names. Signed-off-by: Vlastimil Babka --- mm/slab.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 0cac5d099f8b..78ef4d94e3de 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -793,16 +793,16 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp, static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) { - int page_node = page_to_nid(virt_to_page(objp)); + int slab_node = slab_nid(virt_to_slab(objp)); int node = numa_mem_id(); /* * Make sure we are not freeing a object from another node to the array * cache on this cpu. */ - if (likely(node == page_node)) + if (likely(node == slab_node)) return 0; - return __cache_free_alien(cachep, objp, node, page_node); + return __cache_free_alien(cachep, objp, node, slab_node); } /* @@ -1613,10 +1613,10 @@ static void slab_destroy_debugcheck(struct kmem_cache *cachep, /** * slab_destroy - destroy and release all objects in a slab * @cachep: cache pointer being destroyed - * @page: page pointer being destroyed + * @slab: slab being destroyed * - * Destroy all the objs in a slab page, and release the mem back to the system. - * Before calling the slab page must have been unlinked from the cache. The + * Destroy all the objs in a slab, and release the mem back to the system. + * Before calling the slab must have been unlinked from the cache. The * kmem_cache_node ->list_lock is not held/needed. */ static void slab_destroy(struct kmem_cache *cachep, struct slab *slab) @@ -2560,7 +2560,7 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep, void *freelist; size_t offset; gfp_t local_flags; - int page_node; + int slab_node; struct kmem_cache_node *n; struct slab *slab; @@ -2586,8 +2586,8 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep, if (!slab) goto failed; - page_node = slab_nid(slab); - n = get_node(cachep, page_node); + slab_node = slab_nid(slab); + n = get_node(cachep, slab_node); /* Get colour for the slab, and cal the next value. */ n->colour_next++; @@ -2609,7 +2609,7 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep, /* Get slab management. */ freelist = alloc_slabmgmt(cachep, slab, offset, - local_flags & ~GFP_CONSTRAINT_MASK, page_node); + local_flags & ~GFP_CONSTRAINT_MASK, slab_node); if (OFF_SLAB(cachep) && !freelist) goto opps1;