From patchwork Tue Jan 4 00:10:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12702878 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 7CAE9C433F5 for ; Tue, 4 Jan 2022 00:11:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35E246B00A0; Mon, 3 Jan 2022 19:11:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 092CB6B00A3; Mon, 3 Jan 2022 19:11:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE2966B009E; Mon, 3 Jan 2022 19:11:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 76A0D6B00A3 for ; Mon, 3 Jan 2022 19:11:01 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3AC0F84792 for ; Tue, 4 Jan 2022 00:11:01 +0000 (UTC) X-FDA: 78990674322.07.6E67BFD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf27.hostedemail.com (Postfix) with ESMTP id 8E2C040003 for ; Tue, 4 Jan 2022 00:10:59 +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 AA1A31F3AC; Tue, 4 Jan 2022 00:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1641255059; 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=DkAORBxl9OJ9ns4Jx6bvFCvDYPe0MqXzhPtu2uyCh7A=; b=cSCKkzaUjpNr9zYDIGAYARClzHGJFV071Y37TCsov0yVolx6ZK2VKC7zf6/RbA+XWRHKXF 3aOww0uSXcBOl7Rv7dxA1f1qLEkAmRmKYz4l2j/QPoMaQZ9HNQtFL+V7nIE7OiaYjufMiU Yhe53nK6KS61pCbDvMKvVieS2XD52xk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1641255059; 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=DkAORBxl9OJ9ns4Jx6bvFCvDYPe0MqXzhPtu2uyCh7A=; b=4KzqPRt6f1kAb0ZHlrvSiUJGfTuKSzsdcRA2HtzNbRbNlr3LVEfU4qT5HdQt1RM8siVol5 c1YVSRGlE2JVkyAg== 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 7E1DB139D1; Tue, 4 Jan 2022 00:10:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uIkxHpOQ02FEQwAAMHmgww (envelope-from ); Tue, 04 Jan 2022 00:10:59 +0000 From: Vlastimil Babka To: Matthew Wilcox , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, patches@lists.linux.dev, Vlastimil Babka Subject: [PATCH v4 32/32] mm/slob: Remove unnecessary page_mapcount_reset() function call Date: Tue, 4 Jan 2022 01:10:46 +0100 Message-Id: <20220104001046.12263-33-vbabka@suse.cz> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220104001046.12263-1-vbabka@suse.cz> References: <20220104001046.12263-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1381; i=vbabka@suse.cz; h=from:subject; bh=4bmBjc2hup+DgMeh+mJcnbpGgKsqmASbibT+dn5k/oA=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBh05CFUUv6pwAbJaEzjeLNGm2z0bkmYU7PYKGqRT1C O3dg8LWJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYdOQhQAKCRDgIcpz8YmpEA9kB/ 4qpX8FNV38n805S8kXvh22PGhlAyaYbOzkTkQbRSUES9wz6mLtqSfr4eBcmlcJVVBzeZJZYf2VZ2ug QNOTnYaHvHgT+oUJ2jKFGbG7kWSqRKbR4aAgjhuLEUp1so8WydlP2nWhTQoG0NRDBjhyZE+eCiaBFH slpWg4b49DzR5jxlTeK7CDUhpHFcfqgOl3Ub4KbUlUKYtvy17q6gJcF4QSoHLzAtsXWmazbkUIs8WM fAtejXXvs6Qq/QKe5vqfmKjUw4lulcu4fCMj1ikU0aa1XiQz1HZLoUZnUFTzNWWVwxZVVMMhLDHV+c QWoEnSm6LvyczSTp++MVW3rIka5gWv X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Queue-Id: 8E2C040003 X-Stat-Signature: m8t4sxhjuuiffyte76jwojrzjdum3h3h Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cSCKkzaU; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=4KzqPRt6; dmarc=none; spf=pass (imf27.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-HE-Tag: 1641255059-758530 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: From: Hyeonggon Yoo <42.hyeyoo@gmail.com> After commit f2452d14cdb3 ("mm/sl*b: Differentiate struct slab fields by sl*b implementations"), we can reorder fields of struct slab depending on slab allocator. For now, page_mapcount_reset() is called because page->_mapcount and slab->units have same offset. But this is not necessary for struct slab. Use unused field for units instead. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20211212065241.GA886691@odroid --- mm/slab.h | 4 ++-- mm/slob.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/slab.h b/mm/slab.h index ac8be7dab535..e10d0d4c9bfa 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -50,8 +50,8 @@ struct slab { struct list_head slab_list; void *__unused_1; void *freelist; /* first free block */ - void *__unused_2; - int units; + long units; + unsigned int __unused_2; #else #error "Unexpected slab allocator configured" diff --git a/mm/slob.c b/mm/slob.c index 3c6cadbbc238..60c5842215f1 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -404,7 +404,6 @@ static void slob_free(void *block, int size) clear_slob_page_free(sp); spin_unlock_irqrestore(&slob_lock, flags); __folio_clear_slab(slab_folio(sp)); - page_mapcount_reset(slab_page(sp)); slob_free_pages(b, 0); return; }