From patchwork Tue Nov 16 00:16:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12620849 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 07EB3C433F5 for ; Tue, 16 Nov 2021 00:22:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B099161131 for ; Tue, 16 Nov 2021 00:22:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B099161131 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 42FAD6B007D; Mon, 15 Nov 2021 19:22:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DE4B6B007E; Mon, 15 Nov 2021 19:22:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A5826B0080; Mon, 15 Nov 2021 19:22:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 1D9D96B007D for ; Mon, 15 Nov 2021 19:22:42 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D06C882DBB for ; Tue, 16 Nov 2021 00:22:41 +0000 (UTC) X-FDA: 78812892522.17.649D19E Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf05.hostedemail.com (Postfix) with ESMTP id C70745092A0E for ; Tue, 16 Nov 2021 00:22:15 +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 DC1AB21990; Tue, 16 Nov 2021 00:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637021801; 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=OqLWcO+Oloci4aGZnPi5o+6yGybe4Lal0e+CxqXiEAk=; b=PwkoWDAJh0qvUJo+qN0XFprlzOuyRwNBdinBlbqm7rVS7tWVXUP7nVWxhB+60NE0J+bAtI kwXhgmJUv9zGSSCAppA1DSe9KvzfVQXRdbGaaSvo1T0+2pnxBgoY4GuqaR9V4FnIQ4g21a aDtcAhjN7b07vZjmpED69BBLsMTn/TM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637021801; 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=OqLWcO+Oloci4aGZnPi5o+6yGybe4Lal0e+CxqXiEAk=; b=ZnrsPmrw02LarHJ6pQJXsijlzp2YXs/bKjExxRoJ8P6MP8i9b2FNV94gdLg42AfHyNHh79 8IvxQllo4nvrmKCw== 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 BE468139DB; Tue, 16 Nov 2021 00:16:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eC7bLWn4kmFjXAAAMHmgww (envelope-from ); Tue, 16 Nov 2021 00:16:41 +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 29/32] mm: Remove slab from struct page Date: Tue, 16 Nov 2021 01:16:25 +0100 Message-Id: <20211116001628.24216-30-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=3673; i=vbabka@suse.cz; h=from:subject; bh=xQ8RvyAYQQZ0jtFNdRn6gw2j6nIhwymNoKGXyGwiav0=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhkvhVrUkXuGiS1dKxhEfklRQStPsR+9QLR/1wXYXb cBp94UmJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYZL4VQAKCRDgIcpz8YmpEEPWB/ 0cqUNxVwvtUVnWkaUvSzzkJgJdcPwMEFcI3hcOB89u6HE7TX6fTiyUYTNDkAIOVU/QnKIoFXK2sMTu GTUbHpIYBTnMardfDEu+REPApOb42ceFyr6EzwN1UIFrBcoyJnYsmj5ydkFI+s2RmaUyfTshZdKoVq 6P9bM9rbndGEoe4iChiNXlc/xDp1ewlaDoTrGQ8agkqHyvQvpE5/TzOCjxvSiTgTG6NXxgLwdb7rCW epPcw8oHmpoNB88cuQgVpdQsKyVuShIDhLbOl3ZtBKF1DD9oidXgXFkVr/ZXBFvReHZ4ngexODXANg bwHxXhheVZZ+ptcKgZcS+JA56VXvyJ X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Stat-Signature: 3b8153qweoetwe3y5if3w3fub97tmybi Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=PwkoWDAJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ZnrsPmrw; spf=pass (imf05.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C70745092A0E X-HE-Tag: 1637022135-282921 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: "Matthew Wilcox (Oracle)" All members of struct slab can now be removed from struct page. This shrinks the definition of struct page by 30 LOC, making it easier to understand. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka --- include/linux/mm_types.h | 28 ---------------------------- include/linux/page-flags.h | 37 ------------------------------------- mm/slab.h | 4 ---- 3 files changed, 69 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a70c292474f0..a5103cc418bc 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -107,31 +107,6 @@ struct page { unsigned long dma_addr; atomic_long_t pp_frag_count; }; - struct { /* slab, slob and slub */ - union { - struct list_head slab_list; - struct { /* Partial pages */ - struct page *next; -#ifdef CONFIG_64BIT - int pages; /* Nr of pages left */ -#else - short int pages; -#endif - }; - }; - struct kmem_cache *slab_cache; /* not slob */ - /* Double-word boundary */ - void *freelist; /* first free object */ - union { - void *s_mem; /* slab: first object */ - unsigned long counters; /* SLUB */ - struct { /* SLUB */ - unsigned inuse:16; - unsigned objects:15; - unsigned frozen:1; - }; - }; - }; struct { /* Tail pages of compound page */ unsigned long compound_head; /* Bit zero is set */ @@ -195,9 +170,6 @@ struct page { * which are currently stored here. */ unsigned int page_type; - - unsigned int active; /* SLAB */ - int units; /* SLOB */ }; /* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */ diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 52ec4b5e5615..481fcdcacc7a 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -909,43 +909,6 @@ extern bool is_free_buddy_page(struct page *page); __PAGEFLAG(Isolated, isolated, PF_ANY); -/* - * If network-based swap is enabled, sl*b must keep track of whether pages - * were allocated from pfmemalloc reserves. - */ -static inline int PageSlabPfmemalloc(struct page *page) -{ - VM_BUG_ON_PAGE(!PageSlab(page), page); - return PageActive(page); -} - -/* - * A version of PageSlabPfmemalloc() for opportunistic checks where the page - * might have been freed under us and not be a PageSlab anymore. - */ -static inline int __PageSlabPfmemalloc(struct page *page) -{ - return PageActive(page); -} - -static inline void SetPageSlabPfmemalloc(struct page *page) -{ - VM_BUG_ON_PAGE(!PageSlab(page), page); - SetPageActive(page); -} - -static inline void __ClearPageSlabPfmemalloc(struct page *page) -{ - VM_BUG_ON_PAGE(!PageSlab(page), page); - __ClearPageActive(page); -} - -static inline void ClearPageSlabPfmemalloc(struct page *page) -{ - VM_BUG_ON_PAGE(!PageSlab(page), page); - ClearPageActive(page); -} - #ifdef CONFIG_MMU #define __PG_MLOCKED (1UL << PG_mlocked) #else diff --git a/mm/slab.h b/mm/slab.h index ec2c98e882f1..58b65e5e5d49 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -47,11 +47,7 @@ struct slab { static_assert(offsetof(struct page, pg) == offsetof(struct slab, sl)) SLAB_MATCH(flags, __page_flags); SLAB_MATCH(compound_head, slab_list); /* Ensure bit 0 is clear */ -SLAB_MATCH(slab_list, slab_list); SLAB_MATCH(rcu_head, rcu_head); -SLAB_MATCH(slab_cache, slab_cache); -SLAB_MATCH(s_mem, s_mem); -SLAB_MATCH(active, active); SLAB_MATCH(_refcount, __page_refcount); #ifdef CONFIG_MEMCG SLAB_MATCH(memcg_data, memcg_data);