Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1051665rdd; Wed, 10 Jan 2024 07:19:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpDMAumdUlxF4kEiwyH9OKr2RciQuZfyJW0cGzwiP5wpDLmviG/gTKOVGJc12SkeAXuXGI X-Received: by 2002:a05:6a00:22c4:b0:6d9:b40e:9712 with SMTP id f4-20020a056a0022c400b006d9b40e9712mr352146pfj.32.1704899939923; Wed, 10 Jan 2024 07:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704899939; cv=none; d=google.com; s=arc-20160816; b=CndDr9WX64ONIk7JaYRQLhHKpLtjna/tmBm6W6N/iKGhyC7rqlc5Nsa+JYTu3Wjwth 96wFDJEsSQ1sig6+gMQBmC+BlhKp1Oeh1ul+o4dNkKu9IYwwdt2AUrDF30JOerx2NmIJ RQRq9aLF+r+u+Jp30pK9Bo6lr7Ch8KaJxRv6TPrxsgAOZS2578Vz9Ts0/kubrH6WND4O du7LZQk0VQTac8QcVMfNhVMSjCm3axv63q5+v/vYR2ZBJRs7PEscFibvRpNLc0nuZplv J/EV3vMQImYubxM8KHqRvhxeCFdJpfielMyzOj2J9GBw9Nd3MMcW60+R/O3kvTLm3LrQ fJ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=UL5vikPFUL3XTVX2+kTeC7vhv/d9GbCoWHGEXjwivfQ=; fh=OEgx6rLpvr/WLRPUc5ah5yQpuYiF4q6VDCEkZVSDJqA=; b=VG5PO6LxvJ2NYXGSqRlledKQcmebyKCeHCSSwEwD+q3I6t3mMdSQ0jzzWpdCNt71pz jpQIGdTtIEzmGpw/4SpbvR8Kx4qBYHxofY+Xy2/sl0Nk7DS0+z8EpAQnEIu7WtL/5cO5 IGVPVF19OHJS2uSehuT5x4U2Zba+WRTPqd2WchKIuXrxQbVDdjdYeCApCMuExKmUQouK D2U9TeJou04fBzZhRjusrSdZFuuAzHnJ0obyalXifROfUIwVSCkcO/V/lSRvjBLjoAp/ qzCL9KYW02xsrDiNqtKsMIDjCt0/P7jtqEhQfOG9yqAdYtrMOTcc/1YaJ7C1mISUS3U1 CGXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22412-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 199-20020a6302d0000000b005cec90b9a98si3817178pgc.835.2024.01.10.07.18.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 07:18:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22412-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 390F4281086 for ; Wed, 10 Jan 2024 15:18:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 171D64BAAC; Wed, 10 Jan 2024 15:18:54 +0000 (UTC) Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D27F54BA81 for ; Wed, 10 Jan 2024 15:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-5e784ce9bb8so33949857b3.0 for ; Wed, 10 Jan 2024 07:18:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704899930; x=1705504730; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iI/Hu6Gs4/tJXvwOT57UbLfYusspd0Zm1u4JsSZ3X3A=; b=SJFouqWMMndMKJLGGgQFk4k9ayrBygizHnsSMH+ToBB9nm07MrzlXi7tjy2zCF72Ag iPBL6QUkAoJeS6NDyyKhr12oX0PU4HSQYyg225rTnjfsfmGZ6xlCRo48FXKtARDlHeMS 7JhmQMqHmGWYii8WO3y1149NJL6SvP74MX3PZt2f+4lvBWeNq1N77CJ7YePiACmY5pGz TOGzCMrMjKJXFOOWjODCYhtD5OPvMe8B9y3l2IUnfhaq8rnmJ5AQjRN5a/EquoDHsax8 oIVyWgklzHv9ysneBF8zDjxDiUnJoPajPi83JvORGCiG1sKVMC1SwEvq9+BtMAjHh63v aTxw== X-Gm-Message-State: AOJu0YynPwMAtng+nvaYIWKs2UYX/oBI+VAFMvCTKfZ5k6ng8Vg6NJkW kcE9IkThpYoJ3YOW5m2r9KXgwTlKswA+Uw== X-Received: by 2002:a81:9243:0:b0:5e5:3342:c600 with SMTP id j64-20020a819243000000b005e53342c600mr158700ywg.9.1704899930548; Wed, 10 Jan 2024 07:18:50 -0800 (PST) Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id p71-20020a0de64a000000b005d8ce4ca469sm1638135ywe.99.2024.01.10.07.18.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 07:18:50 -0800 (PST) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-5f2aab1c0c5so40111037b3.0 for ; Wed, 10 Jan 2024 07:18:50 -0800 (PST) X-Received: by 2002:a81:9982:0:b0:5e7:7811:84e9 with SMTP id q124-20020a819982000000b005e7781184e9mr128070ywg.35.1704899929856; Wed, 10 Jan 2024 07:18:49 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240109214828.252092-1-tj@kernel.org> <20240109214828.252092-3-tj@kernel.org> In-Reply-To: <20240109214828.252092-3-tj@kernel.org> From: Geert Uytterhoeven Date: Wed, 10 Jan 2024 16:18:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] kernfs: Rearrange kernfs_node fields to reduce its size on 64bit To: Tejun Heo Cc: gregkh@linuxfoundation.org, andrea.righi@canonical.com, ast@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tejun, On Tue, Jan 9, 2024 at 10:49=E2=80=AFPM Tejun Heo wrote: > Moving .flags and .mode right below .hash makes kernfs_node smaller by 8 > bytes on 64bit. > > Signed-off-by: Tejun Heo Thanks for your patch! > --- a/include/linux/kernfs.h > +++ b/include/linux/kernfs.h > @@ -206,6 +206,9 @@ struct kernfs_node { > > const void *ns; /* namespace tag */ > unsigned int hash; /* ns + name hash */ > + unsigned short flags; > + umode_t mode; > + > union { > struct kernfs_elem_dir dir; > struct kernfs_elem_symlink symlink; > @@ -220,8 +223,6 @@ struct kernfs_node { > */ > u64 id; > > - unsigned short flags; > - umode_t mode; > struct kernfs_iattrs *iattr; Note that there is now a hole at the end of the structure on 32-bit architectures where the alignment of u64 is 8 bytes. Hence, sizeof(struct kernfs_node) grew from 104 to 112 bytes on (at least) arm32 and rv32. It did shrink by 8 bytes on amd64, arm64, mips64, and rv64. Size is unchanged on ia32, m68k and sh. I didn't check any other architectures. Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds