Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp329566rdb; Sat, 30 Sep 2023 06:15:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLOr1i8GmieIjUPotYJ0DYe6LrzKpGO9Cc0DgtQnO2z3IujkYutSY3Xh8xN+nX5IRzaza/ X-Received: by 2002:a05:6a00:1506:b0:693:4143:5145 with SMTP id q6-20020a056a00150600b0069341435145mr7229458pfu.31.1696079732584; Sat, 30 Sep 2023 06:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696079732; cv=none; d=google.com; s=arc-20160816; b=GM3bz4CuOsEJHpSj//HOIp9mkgK0VMsriQxlsZu0Opz9aLJOpIiVvoKBvY6+N1HjK8 l9ZsjPsAZfSicZTbf9K5M8UXB/lvjimaxbPpce5C9SosgdZizG1oDYSwi10/bqc1Pu3+ uPZfumDby0sVMMmM/CFGpRlwzfHmTe/iizMrDfBVBZXxeXNF1ekcLtAmct038qIxKnvy KZ+ULFYb0X6OWbAaB0IR/yE13KvAfG+hKrxmUW0K/G5bMp8QVszmFpVrVsjc8Bvifr+c A4h7cO50P77xbulFs3HZB6u2JWDjl/ythnd3I6trIo7A6HMB9fqqYYsTkzXnUReioSeU 9sSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=AVLzPp93pZABCVKyWP1mAbidMk3rqNAWBwutzFqeRLc=; fh=/7ATBtl13IkXPUVLJiWoEEujdBMJVg+aOBnIIWbOQtQ=; b=AG1yq1zMu44hPls2FN1XX00CgxV1vz492TzgAc69Fnb/H3omQsFsLStoTPejMVRHWB BqyNZWI9b+Oly61zkMbv/NYNlXdWN8Db0ZfzPvcNo67yU4agKZOCLJsWw5vAxFzhspfs EhyPlBKUMZJ/CjwqWjg0I1N12fa6LAPk+Rz+KBJAoBcHCIxS0xrM/qkIONKCKfuOLSZL Ww0DOybWtUNl6xdt5uL+JykLHNoEDEr5w8hDMnvB8wJNxLkle2In2dPN7HdKg8F1O++W 9w+8eqt86Ozfi1KnHpOWjftsxk5vHMPAuP425Nbh7VRMz+JL8Fyxr/I+SMVy4cMdpwV9 TH1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Wat29+YZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b13-20020a056a000ccd00b00690f74dd2ccsi24343943pfv.69.2023.09.30.06.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 06:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Wat29+YZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DCD198067E1E; Fri, 29 Sep 2023 20:26:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233939AbjI3DZ6 (ORCPT + 99 others); Fri, 29 Sep 2023 23:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjI3DZ5 (ORCPT ); Fri, 29 Sep 2023 23:25:57 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B408B4 for ; Fri, 29 Sep 2023 20:25:55 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-773ac11de71so949274385a.2 for ; Fri, 29 Sep 2023 20:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696044354; x=1696649154; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=AVLzPp93pZABCVKyWP1mAbidMk3rqNAWBwutzFqeRLc=; b=Wat29+YZTArt1KnqMhTCNVL7ZA4PFGfHCqdKzpMyMpyPEdeg6ccdV/GdIf+HA2UiL7 HmeUuKAG0A6BgXPCGnO5kGwvl4sPe2FB6hUQ1hBbjv/DFCq2NYVaOttw9yoBPcogRwve EqoevETcpUIb/IROeh2xIZWxa17qB8YAEa6Nypf6pRBMiytlHQW1ZzO65Ft+3mcBQO43 zNn31fVk4efAdyin9tctGJSCBATWj2UyLAb9e7f4TtXZUxfb1x3DHioQUnJehwtZZD33 G6SRgtfq6lrMCOvg0tHcdNgeGvo+4jboinSCRi76IgPFkB6kOUd/TYRjPtQ61eKGeKN1 xOnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696044354; x=1696649154; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AVLzPp93pZABCVKyWP1mAbidMk3rqNAWBwutzFqeRLc=; b=aPlALOKyPVr0+Yk/9HHYZjkSPj9dfbRqOu8vhrAZNIgiy9ofEofMcj3GsdKqWRkBIe FoXPuuOWv7R5wJIQYgS9UPce1Bqxj878NHAVZHFVTI8c8t+vlPv1E3Y+yoC5140PfohX ERW99PPEgkBnIfQ4zoONgFVXXFl6u40k6819lQSgVl+bPWWDfWs7//Cvn07SsEw+Gud8 xjaHtlqUP27bthxO1ZT52w7N4P7gADIYRz80pvBzeKTBV0rXfEjxqBnLjnwMeXkNXAmo 7gdd8iRrugj0IGvKERT/4fz8annJ8Bl206llGUb6soGALmMlXkFr3TRsj8RwmdRV0E11 X78A== X-Gm-Message-State: AOJu0Yxxl9z+lBNQTOKpcHmHFjHJp3sxU3C0uJ7OOYcpzM+XEV20Pu5I YDrMYY3vc1q6pBVSzMWrl8YF835ZVyaSTKuBNlzGIg== X-Received: by 2002:a05:620a:1a1d:b0:773:eb81:d043 with SMTP id bk29-20020a05620a1a1d00b00773eb81d043mr6501303qkb.52.1696044354298; Fri, 29 Sep 2023 20:25:54 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id o7-20020a257307000000b00d43697c429esm5462075ybc.50.2023.09.29.20.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 20:25:53 -0700 (PDT) Date: Fri, 29 Sep 2023 20:25:38 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Christian Brauner , Carlos Maiolino , Chuck Lever , Jan Kara , Matthew Wilcox , Johannes Weiner , Axel Rasmussen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/8] shmem: shrink shmem_inode_info: dir_offsets in a union In-Reply-To: Message-ID: <86ebb4b-c571-b9e8-27f5-cb82ec50357e@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 29 Sep 2023 20:26:14 -0700 (PDT) Shave 32 bytes off (the 64-bit) shmem_inode_info. There was a 4-byte pahole after stop_eviction, better filled by fsflags. And the 24-byte dir_offsets can only be used by directories, whereas shrinklist and swaplist only by shmem_mapping() inodes (regular files or long symlinks): so put those into a union. No change in mm/shmem.c is required for this. Signed-off-by: Hugh Dickins --- include/linux/shmem_fs.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 6b0c626620f5..2caa6b86106a 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -23,18 +23,22 @@ struct shmem_inode_info { unsigned long flags; unsigned long alloced; /* data pages alloced to file */ unsigned long swapped; /* subtotal assigned to swap */ - pgoff_t fallocend; /* highest fallocate endindex */ - struct list_head shrinklist; /* shrinkable hpage inodes */ - struct list_head swaplist; /* chain of maybes on swap */ + union { + struct offset_ctx dir_offsets; /* stable directory offsets */ + struct { + struct list_head shrinklist; /* shrinkable hpage inodes */ + struct list_head swaplist; /* chain of maybes on swap */ + }; + }; + struct timespec64 i_crtime; /* file creation time */ struct shared_policy policy; /* NUMA memory alloc policy */ struct simple_xattrs xattrs; /* list of xattrs */ + pgoff_t fallocend; /* highest fallocate endindex */ + unsigned int fsflags; /* for FS_IOC_[SG]ETFLAGS */ atomic_t stop_eviction; /* hold when working on inode */ - struct timespec64 i_crtime; /* file creation time */ - unsigned int fsflags; /* flags for FS_IOC_[SG]ETFLAGS */ #ifdef CONFIG_TMPFS_QUOTA struct dquot *i_dquot[MAXQUOTAS]; #endif - struct offset_ctx dir_offsets; /* stable entry offsets */ struct inode vfs_inode; }; -- 2.35.3