From patchwork Tue Jun 18 11:35:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junchao Sun X-Patchwork-Id: 13702123 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 3DA421514D9; Tue, 18 Jun 2024 11:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718710515; cv=none; b=G9hoPNNfPRC9PPVEq9kT1cevW2di3SwdhW/Tjc+oEvmMtmkEe3MQKcrfXooh72ac7AdllrvX6oql5hZ9sqtihFq91DnMSD58DJeQQ1tW5gwdjZgnnkmNu1r2idZqyjm0M1cZW1wn23lIo7rsTnjvVIr2KrBkqiVzXh+hvvmtMAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718710515; c=relaxed/simple; bh=tvy1KDoX7BzvM+TQIszHfPGpCYbwly5oJv6QMttbfj0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=k3YseY39V+cdBgaBuLdc/I3w8RsqLAV1JyENqqEAgJZ5/2gumDnJKT6OrgA1rp/I/57M6M6oIqe0ZTsf5XOq/17k4AJlVJU2B4gHg2dChUNXvECXz7q8A3sbUss0fU9li4Ksr3htQSt1zkxSoiGNCL+dGpoS4CeVUZvwyJ+qvwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NiMS8ZRk; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NiMS8ZRk" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1f6a837e9a3so33318605ad.1; Tue, 18 Jun 2024 04:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718710513; x=1719315313; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7RlZFY/8hx3jftd1uqf6MluK/MUBXIl7epplrOLOsNo=; b=NiMS8ZRkSATS58JtgTDDj3gUxgqyLVNh02/BIweuDTqkigyxwBR1yrwyx710QV8ZDp X9BJ/fPDkwRRQ3DfKsQa35w/2AQy3iHk1LvRphmHsCHSQE7NIm/WVmLkqUKf2omPSQsA bCQ1aLNTyQArZ3df74nGpEAV8bYKfBA4YYD6NkTNcT0GQcVJQENV5JFNMyQSkbNeeO9s k3QE7jgTKMlZ30CDNWzcvJ39d2iZxyEIF1NmUR/KAv+WM6lb65BtAnjB+Xj/cK4QBvbG vCoohYXR+WdPDBS6qWnfGE/eEXimDKBTCAG9+IZv0dG82cwwPRo5AGlewGOwKsU4At6z 2UmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718710513; x=1719315313; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7RlZFY/8hx3jftd1uqf6MluK/MUBXIl7epplrOLOsNo=; b=vjf44GPmBoJKP/SFQ5Y3pjP3YJUUWx/wK12A7DenuJJhRgItN2ISjY0sOAyb+OdOEt Vgt3ZBKthUo5ceNjK7g54OCoIuJEpyduIG45MwDnMZuPKkxlwlC7P4itdWUTS1Za4ePq n2aWEhMZicozRqpwhYo5eRK0SEsqoxvFNL/5JslkdlizIpcpW25v2lHM9W7RF17Drm+F 61KEgN04/cWR2pG+F/sxN9KGgjL0jmmGsMTjKxh1wpGOvR40zoEccioaNuTxVEV84fmF lSfuCKQ5pvxgNAzAfGDvl685x1kv7k/DqMROWA/bu/9lpBh6SYk+mEz40jc2J0OjzVye n2bg== X-Forwarded-Encrypted: i=1; AJvYcCUCkG9UPIUwZgprYFYBON8dTd6p0A5GDSVxejEzNnjXrbhNZEaD92UZVaLN92gwP+cH80+psIBywpF1WxmkgGF8xDRrNB1eWN09 X-Gm-Message-State: AOJu0YyuAjypgWiRnb6ScF7Jni0O9ebwYpWW6QVYFfjikbOSyNvbZj5G kJ3i4UG0nNNm7iKrtqX0z2O2zxdztVho0WPseg2semR6NZfhCZfxdrfBrg== X-Google-Smtp-Source: AGHT+IHe+hQzEGMA8sgHFat6BOaxhmQhDamGc0QsNIjTLlGSG3Zyp6fxemBrkymeqY6weBD3stpueA== X-Received: by 2002:a17:902:8505:b0:1f8:3c9e:3b8c with SMTP id d9443c01a7336-1f8625d37damr108884225ad.20.1718710513042; Tue, 18 Jun 2024 04:35:13 -0700 (PDT) Received: from localhost ([114.242.33.243]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f15a9csm95429875ad.222.2024.06.18.04.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 04:35:12 -0700 (PDT) From: Junchao Sun To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, chandan.babu@oracle.com, djwong@kernel.org, Junchao Sun Subject: [PATCH 1/2] xfs: reorder xfs_inode structure elements to remove unneeded padding. Date: Tue, 18 Jun 2024 19:35:04 +0800 Message-Id: <20240618113505.476072-1-sunjunchao2870@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 By reordering the elements in the xfs_inode structure, we can reduce the padding needed on an x86_64 system by 8 bytes. Signed-off-by: Junchao Sun --- fs/xfs/xfs_inode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 292b90b5f2ac..3239ae4e33d2 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -40,8 +40,8 @@ typedef struct xfs_inode { /* Transaction and locking information. */ struct xfs_inode_log_item *i_itemp; /* logging information */ struct rw_semaphore i_lock; /* inode lock */ - atomic_t i_pincount; /* inode pin count */ struct llist_node i_gclist; /* deferred inactivation list */ + atomic_t i_pincount; /* inode pin count */ /* * Bitsets of inode metadata that have been checked and/or are sick. From patchwork Tue Jun 18 11:35:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junchao Sun X-Patchwork-Id: 13702124 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 1C9FF14F113; Tue, 18 Jun 2024 11:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718710521; cv=none; b=u2nxp5cD7se51nbqDNAxd6ZtFzR28sZNGCliKyikCqM3hUdPxqn08akEtywCZ9TXXit70DmLxrifviTiJEtB8HpkCDwZr4o/dfFZEohKZYFO6Fd3mxwIoT/FnN2mUTW5SqE1Zmtyy3+JSHwTn/bOfTDO+awTvVwd4SNDeVOw4l0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718710521; c=relaxed/simple; bh=n47kLEmQKieXHan4dWpUnWxQFa+g8WSINLqmwH5d7P8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N9nseXq//5trdJvVJUV+KtQx0R0nOJVwbnvUEK7VTj2SAC8GMNTDgW7yzxS1eUE8vCgzHOz1sckmAUT62f9AotUYL22524hwmdnX5Z9iNWJ+244TmNTmR42xCJM6rcPzDPu7oNWZLgkbqL0Kg9T04nAWBfGYQhhsMlXVxJF7kBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JUsSTUQV; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JUsSTUQV" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-70423e8e6c9so4661205b3a.0; Tue, 18 Jun 2024 04:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718710519; x=1719315319; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z7flslpC78LMU2Bq6YkuOUsByOSqBWx2+Qe6VdxlJ3Y=; b=JUsSTUQVe5TRty4P1gPHCMbMGt1tLWOzBxAWkdkXEcZSCDwhow6ICkuSydiSc1hf4r VtFWzrKyvcGfiqkZIPRvs9udc5z2Dw5ylGA13Rd3BiTtfE/wB4oFHECDa1qwZSF+2hJI szooNibkjaEyaJ4W9OVrAXCb1/F0rQvLnRmw4z/hLAquOaDMp7BPJGYeS/lLUDvtPes4 LDN3sIan3aspNqT6yFhyb0tf3180sz64lH8+jUp41F1RfCllCr58CWxm4EbTKWy81Nfz 45JVu8+ixkd9HhmaB+Xsiy9/ruX179XAL6Yz+Lzx2WU8oo4eN+d1brfcC4ya4MlnfZ/f tyaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718710519; x=1719315319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z7flslpC78LMU2Bq6YkuOUsByOSqBWx2+Qe6VdxlJ3Y=; b=SqFN164dHHzJvS3WNY2g/k29oHW3np5madcBXuEgs8pi8CNQoZ1GKh7hFRQe7a8CFx 5VUL2SNSvF/NiOWE7BVvCT8Eo7rS3H4edYkSlt1WKxSX1GOnbHC0WdHvgjzcV33aTLBW yUwJcZbv+MnZcYgH6FpphzZ9FmGb0rmf7meLjHdRxhy3kQw5V6H/y0XzgWXiDXzKU30X xFXKc2vnQksvgNNL9Wlom/bJjJCzOaezsfqjdW4ECIzhEN3xRLj95J647R7GryXmDZMe kjGtON9u20/QtJveuCVkTdHYdhGKRz6dskS9SAU2emdGWrj32PQN17gdpYUQ67A2BHw8 40Cg== X-Forwarded-Encrypted: i=1; AJvYcCXdKlr419FMQSv5g90gI13odEq6ikWQgckXd2AYoqnHLNWgrdWBj9G6iw6Mp1qL+qpxB1s27C5AWhTjwE1rpaCBvgQ9jL70trPc X-Gm-Message-State: AOJu0Yzg7+WCkTZc/AlAtPoBycBvBzZ+uKFvDTNdVOd3lqIO9+/RyiSR 1kvdw2Wf0NZDYV4kgerfnhL3/koQiDHa83BnjD1Fjqc7cySW5/nZVYBGAH1H X-Google-Smtp-Source: AGHT+IF7g4VV0x1ZRFkMEt5reEs/zVN0Cj794QAaeGopj7qQO5Kzs6GXfWDzfFOHCHkqR2yd9wP67g== X-Received: by 2002:a05:6a00:4e51:b0:705:bd25:dcb5 with SMTP id d2e1a72fcca58-705d71cc2f5mr11296934b3a.28.1718710518670; Tue, 18 Jun 2024 04:35:18 -0700 (PDT) Received: from localhost ([114.242.33.243]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6fee3013f51sm7862210a12.61.2024.06.18.04.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 04:35:18 -0700 (PDT) From: Junchao Sun To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, chandan.babu@oracle.com, djwong@kernel.org, Junchao Sun Subject: [PATCH 2/2] vfs: reorder struct file structure elements to remove unneeded padding. Date: Tue, 18 Jun 2024 19:35:05 +0800 Message-Id: <20240618113505.476072-2-sunjunchao2870@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240618113505.476072-1-sunjunchao2870@gmail.com> References: <20240618113505.476072-1-sunjunchao2870@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 By reordering the elements in the struct file structure, we can reduce the padding needed on an x86_64 system by 8 bytes. Signed-off-by: Junchao Sun --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 0283cf366c2a..9235b7a960d3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -999,10 +999,10 @@ struct file { */ spinlock_t f_lock; fmode_t f_mode; + unsigned int f_flags; atomic_long_t f_count; struct mutex f_pos_lock; loff_t f_pos; - unsigned int f_flags; struct fown_struct f_owner; const struct cred *f_cred; struct file_ra_state f_ra;