Message ID | 20211116001628.24216-2-vbabka@suse.cz (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=fDmo=QD=kvack.org=owner-linux-mm@kernel.org> 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 37A33C43217 for <linux-mm@archiver.kernel.org>; Tue, 16 Nov 2021 00:16:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC98D63261 for <linux-mm@archiver.kernel.org>; Tue, 16 Nov 2021 00:16:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CC98D63261 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 0FB4D6B007B; Mon, 15 Nov 2021 19:16:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F361F6B007E; Mon, 15 Nov 2021 19:16:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC2406B0088; Mon, 15 Nov 2021 19:16:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id A405B6B007E for <linux-mm@kvack.org>; Mon, 15 Nov 2021 19:16:39 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 608457FAB1 for <linux-mm@kvack.org>; Tue, 16 Nov 2021 00:16:39 +0000 (UTC) X-FDA: 78812877108.19.ECFDCE2 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id BF45A801A8A8 for <linux-mm@kvack.org>; Tue, 16 Nov 2021 00:16:38 +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 306301FD47; Tue, 16 Nov 2021 00:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637021797; 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=yP0SqOpuPx9eb8EEnyvD63PouA1Z0jHphv0AoQv/XJo=; b=tGjSnXFY+1BELb1z4xak1DAHpLSGQC0LH+W0mfl+NpXWZ8da+tOqJaKh5/vwi6ZocWVEY5 oRrOljEeqUTN7D7kx+Qa/odVQhVegynhYDR6kS3Ht1d+rwTAEU2ziaTWZYA5EMy4xvsvr9 YhlB1tosI3F8z1/9LlRif4ZbZXqP89s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637021797; 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=yP0SqOpuPx9eb8EEnyvD63PouA1Z0jHphv0AoQv/XJo=; b=hjkqV0WOstkr5YYQ7zz/XWoQLgXSzI7binb7aoqTg7khokUOUkCAEx3Dy/qFLG7Z37aNV4 qoqAdyqdzqw+1bBw== 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 11CC813F72; Tue, 16 Nov 2021 00:16:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GBC7A2X4kmFjXAAAMHmgww (envelope-from <vbabka@suse.cz>); Tue, 16 Nov 2021 00:16:37 +0000 From: Vlastimil Babka <vbabka@suse.cz> To: Matthew Wilcox <willy@infradead.org>, linux-mm@kvack.org, Christoph Lameter <cl@linux.com>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Pekka Enberg <penberg@kernel.org> Cc: Vlastimil Babka <vbabka@suse.cz> Subject: [RFC PATCH 01/32] mm/slab: Dissolve slab_map_pages() in its caller Date: Tue, 16 Nov 2021 01:15:57 +0100 Message-Id: <20211116001628.24216-2-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=1369; h=from:subject; bh=ZTMT6qGIvfuzfInPvqiwtnDCEPifyx89L5Ppf0r/xYk=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhkvghUXFAQhQLVNnmD2C7sorqIORkNZXU+C5xzd9/ x94wzayJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYZL4IQAKCRDgIcpz8YmpEIh4B/ 0YqQv1Wl5udvvhXH9LTncliDzwHa+TzzjYvhhATnscan2QXR8VtErswTZz0XOtOzjmcSgJV04apDln NiJDNFy8lJfwf0j+xznlq5iHj1PkN8Bl4UeCh48Q0C6nVP/5m6NhWaWD6aKe4tP7ZJe6kyc+hYWbja Do6AUT/WszTQFrlKstGYPf6v42LMots2sAVbP/bIxWdPtjy+jRSXWR/AXpvK22o5JUnVoY20y51gsJ caxeZ28yLEwJZr/BHHlpmC6/lrLf5yb3k9KufF4iCF21l3LphNwTuhImTjAMnZIKBdonXkGO4+s3Nn gKZ/SzGxjX6LC/8NXXbYzSrQlTbiQM X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=tGjSnXFY; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hjkqV0WO; dmarc=none; spf=pass (imf06.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BF45A801A8A8 X-Stat-Signature: 8rcq3kip3j91wnacbjqhfkscefu8w7wr X-HE-Tag: 1637021798-124032 Content-Transfer-Encoding: quoted-printable 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: <linux-mm.kvack.org> |
Series |
Separate struct slab from struct page
|
expand
|
diff --git a/mm/slab.c b/mm/slab.c index da132a9ae6f8..8e71968300c8 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2546,18 +2546,6 @@ static void slab_put_obj(struct kmem_cache *cachep, set_free_obj(page, page->active, objnr); } -/* - * Map pages beginning at addr to the given cache and slab. This is required - * for the slab allocator to be able to lookup the cache and slab of a - * virtual address for kfree, ksize, and slab debugging. - */ -static void slab_map_pages(struct kmem_cache *cache, struct page *page, - void *freelist) -{ - page->slab_cache = cache; - page->freelist = freelist; -} - /* * Grow (by 1) the number of slabs within a cache. This is called by * kmem_cache_alloc() when there are no active objs left in a cache. @@ -2621,7 +2609,8 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep, if (OFF_SLAB(cachep) && !freelist) goto opps1; - slab_map_pages(cachep, page, freelist); + page->slab_cache = cachep; + page->freelist = freelist; cache_init_objs(cachep, page);
The function no longer does what its name and comment suggests, and just sets two struct page fields, which can be done directly in its sole caller. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> --- mm/slab.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)