All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: lustre: Handle nodemask on UMP machines
@ 2015-12-23 17:32 James Simmons
  2015-12-23 17:32 ` [PATCH] staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs James Simmons
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Simmons @ 2015-12-23 17:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Oleg Drokin, Andreas Dilger
  Cc: Linux Kernel Mailing List, lustre-devel, James Simmons, James Simmons

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

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
index 933525c..ba97c79 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
@@ -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)
 {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs
  2015-12-23 17:32 [PATCH v2] staging: lustre: Handle nodemask on UMP machines James Simmons
@ 2015-12-23 17:32 ` James Simmons
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: add debugging ability for LFSCK James Simmons
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: James Simmons @ 2015-12-23 17:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Oleg Drokin, Andreas Dilger
  Cc: Linux Kernel Mailing List, lustre-devel, James Simmons, 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.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3963
Reviewed-on: http://review.whamcloud.com/13070
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |    1 -
 .../lustre/include/linux/libcfs/libcfs_string.h    |    2 --
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 0d8a91e..1574ae2 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -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);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index d8d2e7d..e02cde5 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -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);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] staging: lustre: add debugging ability for LFSCK
  2015-12-23 17:32 [PATCH v2] staging: lustre: Handle nodemask on UMP machines James Simmons
  2015-12-23 17:32 ` [PATCH] staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs James Simmons
@ 2015-12-23 17:32 ` James Simmons
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: add sparse locking annotations James Simmons
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: enum lu_object_header_flags comma style fix James Simmons
  3 siblings, 0 replies; 5+ messages in thread
From: James Simmons @ 2015-12-23 17:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Oleg Drokin, Andreas Dilger
  Cc: Linux Kernel Mailing List, lustre-devel, Fan Yong

From: Fan Yong <fan.yong@intel.com>

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

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
---
 .../lustre/include/linux/libcfs/libcfs_debug.h     |    2 +-
 drivers/staging/lustre/lustre/libcfs/debug.c       |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index a1787bb..98430e7 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c
index 0b38dad..6274558 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -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:
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] staging: lustre: add sparse locking annotations
  2015-12-23 17:32 [PATCH v2] staging: lustre: Handle nodemask on UMP machines James Simmons
  2015-12-23 17:32 ` [PATCH] staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs James Simmons
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: add debugging ability for LFSCK James Simmons
@ 2015-12-23 17:32 ` James Simmons
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: enum lu_object_header_flags comma style fix James Simmons
  3 siblings, 0 replies; 5+ messages in thread
From: James Simmons @ 2015-12-23 17:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Oleg Drokin, Andreas Dilger
  Cc: Linux Kernel Mailing List, lustre-devel, frank zago

From: frank zago <fzago@cray.com>

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

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../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(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index c7b9ccb..176c79b 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -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;
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 477b385..a0955d2 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
index 15782d9..32db788 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 2229419..6b5f8d0 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index efdda09..8f3c26f 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] staging: lustre: enum lu_object_header_flags comma style fix
  2015-12-23 17:32 [PATCH v2] staging: lustre: Handle nodemask on UMP machines James Simmons
                   ` (2 preceding siblings ...)
  2015-12-23 17:32 ` [PATCH v2] staging: lustre: add sparse locking annotations James Simmons
@ 2015-12-23 17:32 ` James Simmons
  3 siblings, 0 replies; 5+ messages in thread
From: James Simmons @ 2015-12-23 17:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Oleg Drokin, Andreas Dilger
  Cc: Linux Kernel Mailing List, lustre-devel, Fan Yong

From: Fan Yong <fan.yong@intel.com>

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.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
---
 drivers/staging/lustre/lustre/include/lu_object.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h
index 1d79341..ee1dbb2 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -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 {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-23 17:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 17:32 [PATCH v2] staging: lustre: Handle nodemask on UMP machines James Simmons
2015-12-23 17:32 ` [PATCH] staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs James Simmons
2015-12-23 17:32 ` [PATCH v2] staging: lustre: add debugging ability for LFSCK James Simmons
2015-12-23 17:32 ` [PATCH v2] staging: lustre: add sparse locking annotations James Simmons
2015-12-23 17:32 ` [PATCH v2] staging: lustre: enum lu_object_header_flags comma style fix James Simmons

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.