Skip to contentSkip to conversation

staging: lustre: Handle nodemask on UMP machines

PATCH New James Simmons 1 participant 5 messages Dec 23, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: lustre: Handle nodemask on UMP machines

For UMP and SMP machines the struct cfs_cpt_table are defined differently. In the case handled by this patch nodemask is defined as a integer for the UMP case and as a pointer for the SMP case. This will cause a problem for ost_setup which reads the nodemask directly. Instead we create a UMP version of cfs_cpt_nodemask and use that in ost_setup.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
Reviewed-on: http://review.whamcloud.com/9219

Starting in 3.14 kernels nodemask_t was changed from a a unsigned long to a linux bitmap so more than 32 cores could be supported. Using set_bit in cfs_cpt_table_alloc no longer compiles so this patch backports bits of the node management function that use a linux bitmap back end. Cleaned up libcfs bitmap.h to use the libcfs layers memory allocation function. This was pulling in lustre related code that was not defined.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
Reviewed-on: http://review.whamcloud.com/10332

---
 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c +8 -0
index 933525c..ba97c79 100644
@@ -58,6 +58,7 @@ cfs_cpt_table_alloc(unsigned int ncpt)
 	LIBCFS_ALLOC(cptab, sizeof(*cptab));
 	if (cptab != NULL) {
 		cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
+		node_set(0, cptab->ctb_nodemask);
 		cptab->ctb_nparts  = ncpt;
 	}
 
@@ -111,6 +112,13 @@ cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
 }
 EXPORT_SYMBOL(cfs_cpt_online);
 
+nodemask_t *
+cfs_cpt_nodemask(struct cfs_cpt_table *cptab, int cpt)
+{
+	return &cptab->ctb_nodemask;
+}
+EXPORT_SYMBOL(cfs_cpt_cpumask);
+
 int
 cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 {
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 staging: lustre: enum lu_object_header_flags comma style fix

From: Fan Yong <[email protected]>

Cleanup the a style issues for the lu_object_header_flags enum by adding a comma for the last field. This is broken out of patch http://review.whamcloud.com/6321.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321

---
 drivers/staging/lustre/lustre/include/lu_object.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/lustre/lustre/include/lu_object.h +1 -1
index 1d79341..ee1dbb2 100644
@@ -488,7 +488,7 @@ enum lu_object_header_flags {
 	/**
 	 * Mark this object has already been taken out of cache.
 	 */
-	LU_OBJECT_UNHASHED = 1
+	LU_OBJECT_UNHASHED = 1,
 };
 
 enum lu_object_header_attr {
Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 1/1 staging: lustre: add sparse locking annotations

In reply to James Simmons

From: frank zago <[email protected]>

Adds __acquires / __releases / __must_hold sparse locking annotations to several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
- wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
- unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
- wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
'cfs_hash_rw_unlock' - unexpected unlock

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295

---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |    3 +--
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |    1 +
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c |    2 ++
 drivers/staging/lustre/lustre/osc/osc_cache.c      |    3 +++
 drivers/staging/lustre/lustre/ptlrpc/client.c      |    1 +
 5 files changed, 8 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +1 -2
index c7b9ccb..176c79b 100644
@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
 
 static int
 kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit)
-	__releases(conn->ibc_lock)
-	__acquires(conn->ibc_lock)
+	__must_hold(&conn->ibc_lock)
 {
 	kib_msg_t *msg = tx->tx_msg;
 	kib_peer_t *peer = conn->ibc_peer;
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +1 -0
index 477b385..a0955d2 100644
@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)
 
 static int
 ksocknal_send_keepalive_locked(ksock_peer_t *peer)
+	__must_hold(&ksocknal_data.ksnd_global_lock)
 {
 	ksock_sched_t *sched;
 	ksock_conn_t *conn;
drivers/staging/lustre/lustre/libcfs/libcfs_lock.c +2 -0
index 15782d9..32db788 100644
@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
  */
 void
 cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
+	__acquires(pcl->pcl_locks)
 {
 	int	ncpt = cfs_cpt_number(pcl->pcl_cptab);
 	int	i;
@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock);
 /** unlock a CPU partition */
 void
 cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
+	__releases(pcl->pcl_locks)
 {
 	int	ncpt = cfs_cpt_number(pcl->pcl_cptab);
 	int	i;
drivers/staging/lustre/lustre/osc/osc_cache.c +3 -0
index 2229419..6b5f8d0 100644
@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, struct list_head *rpclist)
 static int
 osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
 		   struct osc_object *osc)
+	__must_hold(osc)
 {
 	LIST_HEAD(rpclist);
 	struct osc_extent *ext;
@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
 static int
 osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
 		  struct osc_object *osc)
+	__must_hold(osc)
 {
 	struct osc_extent *ext;
 	struct osc_extent *next;
@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)
 
 /* called with the loi list lock held */
 static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
+	__must_hold(&cli->cl_loi_list_lock)
 {
 	struct osc_object *osc;
 	int rc = 0;
drivers/staging/lustre/lustre/ptlrpc/client.c +1 -0
index efdda09..8f3c26f 100644
@@ -353,6 +353,7 @@ static int unpack_reply(struct ptlrpc_request *req)
  * If anything goes wrong just ignore it - same as if it never happened
  */
 static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
+	__must_hold(&req->rq_lock)
 {
 	struct ptlrpc_request *early_req;
 	time64_t olddl;
Signature · 1 line
1.7.1
#3 lore raw

PATCH v2 1/1 staging: lustre: add debugging ability for LFSCK

In reply to James Simmons

From: Fan Yong <[email protected]>

Add the ability to debug LFSCK to libcfs. This is broken out of patch http://review.whamcloud.com/6321.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321

---
 .../lustre/include/linux/libcfs/libcfs_debug.h     |    2 +-
 drivers/staging/lustre/lustre/libcfs/debug.c       |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +1 -1
index a1787bb..98430e7 100644
@@ -106,7 +106,7 @@ struct ptldebug_header {
 #define S_LOV		0x00020000
 #define S_LQUOTA	0x00040000
 #define S_OSD		0x00080000
-/* unused */
+#define S_LFSCK		0x00100000
 /* unused */
 /* unused */
 #define S_LMV		0x00800000 /* b_new_cmd */
drivers/staging/lustre/lustre/libcfs/debug.c +2 -0
index 0b38dad..6274558 100644
@@ -271,6 +271,8 @@ libcfs_debug_subsys2str(int subsys)
 		return "lquota";
 	case S_OSD:
 		return "osd";
+	case S_LFSCK:
+		return "lfsck";
 	case S_LMV:
 		return "lmv";
 	case S_SEC:
Signature · 1 line
1.7.1
#4 lore raw

PATCH 1/1 staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs

In reply to James Simmons

Remove libcfs function cfs_strncasecmp() since the kernel already has its own strncasecmp(). Lastly remove from libcfs.h cfs_get_blocked_sigs() since this function no longer exist.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3963
Reviewed-on: http://review.whamcloud.com/13070

---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |    1 -
 .../lustre/include/linux/libcfs/libcfs_string.h    |    2 --
 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs.h +0 -1
index 0d8a91e..1574ae2 100644
@@ -90,7 +90,6 @@ void cfs_enter_debugger(void);
  * Defined by platform
  */
 int unshare_fs_struct(void);
-sigset_t cfs_get_blocked_sigs(void);
 sigset_t cfs_block_allsigs(void);
 sigset_t cfs_block_sigs(unsigned long sigs);
 sigset_t cfs_block_sigsinv(unsigned long sigs);
drivers/staging/lustre/include/linux/libcfs/libcfs_string.h +0 -2
index d8d2e7d..e02cde5 100644
@@ -44,8 +44,6 @@
 #define __LIBCFS_STRING_H__
 
 /* libcfs_string.c */
-/* string comparison ignoring case */
-int cfs_strncasecmp(const char *s1, const char *s2, size_t n);
 /* Convert a text string to a bitmask */
 int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
 		 int *oldmask, int minmask, int allmask);
Signature · 1 line
1.7.1