linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH 19/35] staging: lustre: obdclass: remove structure holes to reduce memory
Date: Thu, 10 Nov 2016 12:30:49 -0500	[thread overview]
Message-ID: <1478799065-24841-20-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1478799065-24841-1-git-send-email-jsimmons@infradead.org>

From: Andreas Dilger <andreas.dilger@intel.com>

Fix the alignment of fields in commonly-used structures to reduce
memory usage on the client and server.  Structures fixed:

ptlrpc_reply_state: reduced by 8 bytes
obd_device:         reduced by 16 bytes
niobuf_local:       reduced by 8 bytes

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3281
Reviewed-on: http://review.whamcloud.com/16692
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_net.h |    7 ++--
 drivers/staging/lustre/lustre/include/obd.h        |   38 ++++++++++----------
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h
index 7f549a3..d2cbec3 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -438,6 +438,10 @@ struct ptlrpc_reply_state {
 	unsigned long	  rs_committed:1;/* the transaction was committed
 					  * and the rs was dispatched
 					  */
+	atomic_t		rs_refcount;	/* number of users */
+	/** Number of locks awaiting client ACK */
+	int			rs_nlocks;
+
 	/** Size of the state */
 	int		    rs_size;
 	/** opcode */
@@ -450,7 +454,6 @@ struct ptlrpc_reply_state {
 	struct ptlrpc_service_part *rs_svcpt;
 	/** Lnet metadata handle for the reply */
 	lnet_handle_md_t       rs_md_h;
-	atomic_t	   rs_refcount;
 
 	/** Context for the service thread */
 	struct ptlrpc_svc_ctx *rs_svc_ctx;
@@ -467,8 +470,6 @@ struct ptlrpc_reply_state {
 	 */
 	struct lustre_msg     *rs_msg;	  /* reply message */
 
-	/** Number of locks awaiting client ACK */
-	int		    rs_nlocks;
 	/** Handles of locks awaiting client reply ACK */
 	struct lustre_handle   rs_locks[RS_MAX_LOCKS];
 	/** Lock modes of locks in \a rs_locks */
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index ffe09a3..a346312 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -428,9 +428,9 @@ struct niobuf_local {
 	__u32		lnb_page_offset;
 	__u32		lnb_len;
 	__u32		lnb_flags;
+	int		lnb_rc;
 	struct page	*lnb_page;
 	void		*lnb_data;
-	int		lnb_rc;
 };
 
 #define LUSTRE_FLD_NAME	 "fld"
@@ -531,15 +531,14 @@ struct lvfs_run_ctxt {
 
 struct obd_device {
 	struct obd_type	*obd_type;
-	__u32		   obd_magic;
+	u32			 obd_magic; /* OBD_DEVICE_MAGIC */
+	int			 obd_minor; /* device number: lctl dl */
+	struct lu_device	*obd_lu_dev;
 
 	/* common and UUID name of this device */
-	char		    obd_name[MAX_OBD_NAME];
-	struct obd_uuid	 obd_uuid;
+	struct obd_uuid		 obd_uuid;
+	char			 obd_name[MAX_OBD_NAME];
 
-	struct lu_device       *obd_lu_dev;
-
-	int		     obd_minor;
 	/* bitfield modification is protected by obd_dev_lock */
 	unsigned long obd_attached:1,      /* finished attach */
 		      obd_set_up:1,	/* finished setup */
@@ -563,22 +562,22 @@ struct obd_device {
 	unsigned long obd_recovery_expired:1;
 	/* uuid-export hash body */
 	struct cfs_hash	     *obd_uuid_hash;
-	atomic_t	    obd_refcount;
 	wait_queue_head_t	     obd_refcount_waitq;
 	struct list_head	      obd_exports;
 	struct list_head	      obd_unlinked_exports;
 	struct list_head	      obd_delayed_exports;
+	atomic_t			obd_refcount;
 	int		     obd_num_exports;
 	spinlock_t		obd_nid_lock;
 	struct ldlm_namespace  *obd_namespace;
 	struct ptlrpc_client	obd_ldlm_client; /* XXX OST/MDS only */
 	/* a spinlock is OK for what we do now, may need a semaphore later */
 	spinlock_t		obd_dev_lock; /* protect OBD bitfield above */
-	struct mutex		obd_dev_mutex;
-	__u64			obd_last_committed;
 	spinlock_t		obd_osfs_lock;
 	struct obd_statfs	obd_osfs;       /* locked by obd_osfs_lock */
 	__u64			obd_osfs_age;
+	u64			obd_last_committed;
+	struct mutex		obd_dev_mutex;
 	struct lvfs_run_ctxt	obd_lvfs_ctxt;
 	struct obd_llog_group	obd_olg;	/* default llog group */
 	struct obd_device	*obd_observer;
@@ -592,12 +591,13 @@ struct obd_device {
 		struct lov_obd lov;
 		struct lmv_obd lmv;
 	} u;
+
 	/* Fields used by LProcFS */
-	unsigned int	   obd_cntr_base;
-	struct lprocfs_stats  *obd_stats;
+	struct lprocfs_stats	*obd_stats;
+	unsigned int		 obd_cntr_base;
 
-	unsigned int	   md_cntr_base;
-	struct lprocfs_stats  *md_stats;
+	struct lprocfs_stats	*md_stats;
+	unsigned int		 md_cntr_base;
 
 	struct dentry		*obd_debugfs_entry;
 	struct dentry		*obd_svc_debugfs_entry;
@@ -609,9 +609,11 @@ struct obd_device {
 	/**
 	 * Ldlm pool part. Save last calculated SLV and Limit.
 	 */
-	rwlock_t		obd_pool_lock;
-	int		    obd_pool_limit;
-	__u64		  obd_pool_slv;
+	rwlock_t		 obd_pool_lock;
+	u64			 obd_pool_slv;
+	int			 obd_pool_limit;
+
+	int			 obd_conn_inprogress;
 
 	/**
 	 * A list of outstanding class_incref()'s against this obd. For
@@ -619,8 +621,6 @@ struct obd_device {
 	 */
 	struct lu_ref	  obd_reference;
 
-	int		       obd_conn_inprogress;
-
 	struct kobject		obd_kobj; /* sysfs object */
 	struct completion	obd_kobj_unregister;
 };
-- 
1.7.1

  parent reply	other threads:[~2016-11-10 17:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 17:30 [PATCH 00/35] second batch of missing lustre 2.8 patches James Simmons
2016-11-10 17:30 ` [PATCH 01/35] staging: lustre: hsm: Use file lease to implement migration James Simmons
2016-11-10 17:30 ` [PATCH 02/35] staging: lustre: obd: rename obd_unpackmd() to md_unpackmd() James Simmons
2016-11-10 17:30 ` [PATCH 03/35] staging: lustre: ptlrpc: mbits is sent within ptlrpc_body James Simmons
2016-11-10 17:30 ` [PATCH 04/35] staging: lustre: lov: init LOV stripe type beforehand James Simmons
2016-11-10 17:30 ` [PATCH 05/35] staging: lustre: llog: fix wrong offset in llog_process_thread() James Simmons
2016-11-11  4:35   ` kbuild test robot
2016-11-10 17:30 ` [PATCH 06/35] staging: lustre: osc: Performance tune for LRU James Simmons
2016-11-11  5:16   ` kbuild test robot
2016-11-10 17:30 ` [PATCH 07/35] staging: lustre: lov: avoid infinite loop in lsm_alloc_plain() James Simmons
2016-11-10 17:30 ` [PATCH 08/35] staging: lustre: lmv: lock necessary part of lmv_add_target James Simmons
2016-11-10 17:30 ` [PATCH 09/35] staging: lustre: mgc: IR log failure should not stop mount James Simmons
2016-11-10 17:30 ` [PATCH 10/35] staging: lustre: lmv: revalidate the dentry for striped dir James Simmons
2016-11-10 17:30 ` [PATCH 11/35] staging: lustre: ptlrpc: race at req processing James Simmons
2016-11-10 17:30 ` [PATCH 12/35] staging: lustre: clio: get rid of cl_req James Simmons
2016-11-10 17:30 ` [PATCH 13/35] staging: lustre: llite: lookup master inode by ilookup5_nowait James Simmons
2016-11-10 17:30 ` [PATCH 14/35] staging: lustre: nrs: serialize executions of nrs_policy_stop James Simmons
2016-11-10 17:30 ` [PATCH 15/35] staging: lustre: llite: tar restore fails for HSM released files James Simmons
2016-11-10 17:30 ` [PATCH 16/35] staging: lustre: llite: support SELinux context labelling James Simmons
2016-11-10 17:30 ` [PATCH 17/35] staging: lustre: obd: Remove dead code in precleanup James Simmons
2016-11-10 17:30 ` [PATCH 18/35] staging: lustre: osc: fix max_dirty_mb tunable setting limit James Simmons
2016-11-10 17:30 ` James Simmons [this message]
2016-11-10 17:30 ` [PATCH 20/35] staging: lustre: ptlrpc: Move IT_* definitions to lustre_idl.h James Simmons
2016-11-10 17:30 ` [PATCH 21/35] staging: lustre: statahead: lock leaks if statahead file recreated James Simmons
2016-11-10 17:30 ` [PATCH 22/35] staging: lustre: llite: clear dir stripe md in ll_iget James Simmons
2016-11-10 17:30 ` [PATCH 23/35] staging: lustre: ldlm: improve lock timeout messages James Simmons
2016-11-10 17:30 ` [PATCH 24/35] staging: lustre: osc: osc_extent should hold refcount to osc_object James Simmons
2016-11-10 17:30 ` [PATCH 25/35] staging: lustre: osc: Do not merge extents with partial pages James Simmons
2016-11-10 17:30 ` [PATCH 26/35] staging: lustre: mdc: remove console spew from mdc_ioc_fid2path James Simmons
2016-11-10 17:30 ` [PATCH 27/35] staging: lustre: ptlrpc: reset imp_replay_cursor James Simmons
2016-11-10 17:30 ` [PATCH 28/35] staging: lustre: osc: Remove remains of osc_ast_guard James Simmons
2016-11-10 17:30 ` [PATCH 29/35] staging: lustre: misc: clean up DFID related error messages James Simmons
2016-11-10 17:31 ` [PATCH 30/35] staging: lustre: llite: ll_write_begin/end not passing on errors James Simmons
2016-11-10 17:31 ` [PATCH 31/35] staging: lustre: obdclass: add export for lprocfs_stats_alloc_one() James Simmons
2016-11-14 14:59   ` Greg Kroah-Hartman
2016-11-10 17:31 ` [PATCH 32/35] staging: lustre: mount: fix lmd_parse() to handle commas in expr_list James Simmons
2016-11-14 15:12   ` Greg Kroah-Hartman
2016-11-18 16:54     ` James Simmons
2016-11-18 17:14       ` Greg Kroah-Hartman
2016-11-10 17:31 ` [PATCH 33/35] staging: lustre: hsm: prevent migration of HSM archived files James Simmons
2016-11-10 17:31 ` [PATCH 34/35] staging: lustre: lnet: add offset for selftest brw James Simmons
2016-11-10 17:31 ` [PATCH 35/35] staging: lustre: idl: clean up file attribute flags James Simmons
2016-11-14 15:16 ` [PATCH 00/35] second batch of missing lustre 2.8 patches Greg Kroah-Hartman
2016-11-14 18:27   ` James Simmons
2016-11-15 10:00     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478799065-24841-20-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).