Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368354 > unrolled thread

[PATCH 0/6] cleanup libcfs memory handling

Started byJames Simmons <jsimmons@infradead.org>
First post2016-03-31 16:30 +0200
Last post2016-03-31 16:30 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/6] cleanup libcfs memory handling James Simmons <jsimmons@infradead.org> - 2016-03-31 16:30 +0200
    [PATCH 1/6] staging: lustre: libcfs: move add_wait_queue_exclusive_head to lustre layer James Simmons <jsimmons@infradead.org> - 2016-03-31 16:30 +0200

#1368354 — [PATCH 0/6] cleanup libcfs memory handling

FromJames Simmons <jsimmons@infradead.org>
Date2016-03-31 16:30 +0200
Subject[PATCH 0/6] cleanup libcfs memory handling
Message-ID<riLC2-6ib-9@gated-at.bofh.it>
The libcfs module contains memory handling which needs to be
cleaned up. First cleanup is to merge linux-mem.h and libcfs_prim.h.
This is left over for when libcfs was both a kernel module
and a userspace library. Second cleanup is remove some wrappers
that are not needed. Just use kernel API's directly instead.
One last change is the move of add_wait_queue_exclusive_head
to the lustre layer since that is the only place it is used.
With these changes linux-mem.h can be deleted.

James Simmons (6):
  staging: lustre: libcfs: move add_wait_queue_exclusive_head to lustre layer
  staging: lustre: libcfs: move memory_pressure functions to libcfs_prim.h
  staging: lustre: libcfs: remove page_index() macro
  staging: lustre: libcfs: remove MMSPACE macros
  staging: lustre: libcfs: move NUM_CACHEPAGES to libcfs_prim.h
  staging: lustre: libcfs: delete linux-mem.h

 .../lustre/include/linux/libcfs/libcfs_prim.h      |   31 +++++---
 .../lustre/include/linux/libcfs/linux/libcfs.h     |    2 +-
 .../lustre/include/linux/libcfs/linux/linux-cpu.h  |    2 +-
 .../lustre/include/linux/libcfs/linux/linux-mem.h  |   79 --------------------
 .../staging/lustre/lnet/libcfs/linux/linux-prim.c  |   24 ------
 drivers/staging/lustre/lnet/libcfs/tracefile.c     |   17 ++--
 drivers/staging/lustre/lustre/include/lustre_lib.h |   22 ++++++
 drivers/staging/lustre/lustre/llite/vvp_page.c     |    2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    |    2 +-
 9 files changed, 55 insertions(+), 126 deletions(-)
 delete mode 100644 drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h

[toc] | [next] | [standalone]


#1368355 — [PATCH 1/6] staging: lustre: libcfs: move add_wait_queue_exclusive_head to lustre layer

FromJames Simmons <jsimmons@infradead.org>
Date2016-03-31 16:30 +0200
Subject[PATCH 1/6] staging: lustre: libcfs: move add_wait_queue_exclusive_head to lustre layer
Message-ID<riLLI-6lZ-17@gated-at.bofh.it>
In reply to#1368354
Only lustre client uses add_wait_queue_exclusive_head() so move
it from libcfs layer to lustre_lib.h where it is needed.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/13874
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../lustre/include/linux/libcfs/libcfs_prim.h      |    2 -
 .../staging/lustre/lnet/libcfs/linux/linux-prim.c  |   24 --------------------
 drivers/staging/lustre/lustre/include/lustre_lib.h |   22 ++++++++++++++++++
 3 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
index 082fe6d..d7846e8 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
@@ -40,8 +40,6 @@
 #ifndef __LIBCFS_PRIM_H__
 #define __LIBCFS_PRIM_H__
 
-void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
-
 /*
  * Memory
  */
diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c
index 7e5ef0a..bbe19a6 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c
@@ -46,30 +46,6 @@
 #include <linux/kgdb.h>
 #endif
 
-/**
- * wait_queue_t of Linux (version < 2.6.34) is a FIFO list for exclusively
- * waiting threads, which is not always desirable because all threads will
- * be waken up again and again, even user only needs a few of them to be
- * active most time. This is not good for performance because cache can
- * be polluted by different threads.
- *
- * LIFO list can resolve this problem because we always wakeup the most
- * recent active thread by default.
- *
- * NB: please don't call non-exclusive & exclusive wait on the same
- * waitq if add_wait_queue_exclusive_head is used.
- */
-void
-add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&waitq->lock, flags);
-	__add_wait_queue_exclusive(waitq, link);
-	spin_unlock_irqrestore(&waitq->lock, flags);
-}
-EXPORT_SYMBOL(add_wait_queue_exclusive_head);
-
 sigset_t
 cfs_block_allsigs(void)
 {
diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h
index 2e66b27..00b9767 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -522,6 +522,28 @@ struct l_wait_info {
 			   sigmask(SIGTERM) | sigmask(SIGQUIT) |	\
 			   sigmask(SIGALRM))
 
+/**
+ * wait_queue_t of Linux (version < 2.6.34) is a FIFO list for exclusively
+ * waiting threads, which is not always desirable because all threads will
+ * be waken up again and again, even user only needs a few of them to be
+ * active most time. This is not good for performance because cache can
+ * be polluted by different threads.
+ *
+ * LIFO list can resolve this problem because we always wakeup the most
+ * recent active thread by default.
+ *
+ * NB: please don't call non-exclusive & exclusive wait on the same
+ * waitq if add_wait_queue_exclusive_head is used.
+ */
+#define add_wait_queue_exclusive_head(waitq, link)		\
+{								\
+	unsigned long flags;					\
+								\
+	spin_lock_irqsave(&((waitq)->lock), flags);		\
+	__add_wait_queue_exclusive(waitq, link);		\
+	spin_unlock_irqrestore(&((waitq)->lock), flags);	\
+}
+
 /*
  * wait for @condition to become true, but no longer than timeout, specified
  * by @info.
-- 
1.7.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web