Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1944508rdb; Tue, 3 Oct 2023 06:06:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEc9sW3l71Zf4h3Ul0kmswv992ysufl07FqxEwSoCaCTgp2yllQL9kJdYaVPd3JBrMytXOD X-Received: by 2002:a05:6a20:6a0c:b0:154:3f13:1bb7 with SMTP id p12-20020a056a206a0c00b001543f131bb7mr17349079pzk.49.1696338419141; Tue, 03 Oct 2023 06:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696338419; cv=none; d=google.com; s=arc-20160816; b=QhA8Tspp3pF9xkIGJXpoGRDke3udwWeZvKzWKVAn4/f5EMkT32yd+9Y0cfXDw+6Qr/ d4fU2tz8C9MMFq1vAGdrA12aoQAiRnUzf/RBx3cTyUsg/PUeE9lHfdB3UD/qPIQmqlyP 3P43QOsURHalGFu31wcNEuRut1qb2gpqRI+SLvOmjOyLowQunHYdUvy9JyiwzYLPiEek 5G3pFBQUukWSb4P2QxmJngSiEddumzyW8jgu+pdThdQu3xpUzqu/zp5BOlhSZLOw9EDB FF8lY5UceUYAExTevtlTVHTfAS3jhTNSJgHJeUxN6Jk1IQCNs5xvZKVB3eQXtuBXydDQ lFfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=hBW6aALkPO3CT6TaCsu8tN/6UcJj9gFut487AL5616w=; fh=AJq6fOzBFVmx73gpyiQEeL2QptW2TwogVske581TpYk=; b=Uu1+GtnUd0klT59Gmh3L4K6SKdkIK2kbzFLiwCYRcuGoWGoexF6DGZwh5jI/92pwEB BjvpxmyPE8p3r4x82myLDv1aDP9dUH5FcYyBkTr7cOg5xeGGISg13yZwnhGTRBJxOfqK y8HsVdQ+Y7ayc9SxRCp74lXNCnzmcER4wf5IHoSbRbgd1cDD1M7tW9vZ/iiPMUy2VR6/ exo8UFg3YStQV04R0evF5WRlQHQCZ+UCispkYTKd4tUOyYD9SHSq9lN425nd8l9yTFO2 mdtN7zEV21UCfbhVuCRMTcff7BTJLcTFuKHW2kExg87RF0yKllBP9JpaBcQynseJNnk5 Y3gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QcRQPssu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m22-20020a056a00081600b00689f1186cfdsi1540522pfk.29.2023.10.03.06.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:06:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QcRQPssu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A3E9E807BA31; Tue, 3 Oct 2023 06:06:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbjJCNGl (ORCPT + 99 others); Tue, 3 Oct 2023 09:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjJCNGk (ORCPT ); Tue, 3 Oct 2023 09:06:40 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24ECAC4; Tue, 3 Oct 2023 06:06:37 -0700 (PDT) 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 C0E9A1F45B; Tue, 3 Oct 2023 13:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696338395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hBW6aALkPO3CT6TaCsu8tN/6UcJj9gFut487AL5616w=; b=QcRQPssugIvbxgWLAS2VGtKXSx5CY+ZdaiiMLY/XHjeNBNDY9OvYCcKBYgNN59N2Ca9Ujt v9DWcdQk/XBqS9rfr/U1yUBwv7XK0fJXdts9d4QEXRdZPW4OIqFv1d/7TioCl6X+rIlGnE /8kAOQVAL1yabk1Ph3hrWl1Knj/wMvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696338395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hBW6aALkPO3CT6TaCsu8tN/6UcJj9gFut487AL5616w=; b=LlKeH0O8KpUR1zRBRWw/IGDhqnN8yAglhJMlsJSXEM9+ntps/cNngnCnQkSIL9gIP8APUw MHCgdFAKRgkXWnAw== 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 B0EBD132D4; Tue, 3 Oct 2023 13:06:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HSUnK9sRHGUvLgAAMHmgww (envelope-from ); Tue, 03 Oct 2023 13:06:35 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 3C9D0A07CC; Tue, 3 Oct 2023 15:06:35 +0200 (CEST) Date: Tue, 3 Oct 2023 15:06:35 +0200 From: Jan Kara To: Hugh Dickins Cc: Andrew Morton , 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: Re: [PATCH 1/8] shmem: shrink shmem_inode_info: dir_offsets in a union Message-ID: <20231003130635.hn2ljuorlf7rdodx@quack3> References: <86ebb4b-c571-b9e8-27f5-cb82ec50357e@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ebb4b-c571-b9e8-27f5-cb82ec50357e@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:06:56 -0700 (PDT) On Fri 29-09-23 20:25:38, Hugh Dickins wrote: > 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 Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR