Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1389630
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 13/15] staging: lustre: osc: Track number of "unstable" pages per osc |
| Date | 2016-04-28 00:30 +0200 |
| Message-ID | <rsG83-KT-27@gated-at.bofh.it> (permalink) |
| References | <rsG82-KT-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Prakash Surya <surya1@llnl.gov>
This change adds simple accounting hooks for "unstable" pages on a per
OSC basis. Now, in addition to the per filesystem tracking, each OSC
will maintain a running total of its unstable pages. These counters are
exported through the proc interface, and can be read using the lctl
command.
For example:
# Read number of unstable pages contained by each OSC
lctl get_param osc.*.unstable_stats
The motivation for this change is in anticipation of implementing a
"soft sync" functionality, urging servers to commit these unstable
pages to stable storage. The per OSC accounting allows a client to
limit the soft sync request to only the OSCs which have outstanding
unstable pages.
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2139
Reviewed-on: http://review.whamcloud.com/4374
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/lustre/include/obd.h | 1 +
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 1 +
drivers/staging/lustre/lustre/osc/lproc_osc.c | 18 ++++++++++++++++++
drivers/staging/lustre/lustre/osc/osc_cache.c | 6 ++++++
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 3f24a5b..d0c0c26 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -325,6 +325,7 @@ struct client_obd {
atomic_t cl_lru_in_list;
struct list_head cl_lru_list; /* lru page list */
spinlock_t cl_lru_list_lock; /* page list protector */
+ atomic_t cl_unstable_count;
/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
atomic_t cl_destroy_in_flight;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index bc951c0..32486b2 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -334,6 +334,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
atomic_set(&cli->cl_lru_in_list, 0);
INIT_LIST_HEAD(&cli->cl_lru_list);
spin_lock_init(&cli->cl_lru_list_lock);
+ atomic_set(&cli->cl_unstable_count, 0);
init_waitqueue_head(&cli->cl_destroy_waitq);
atomic_set(&cli->cl_destroy_in_flight, 0);
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 6e57f53..33a1132 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -593,6 +593,23 @@ static ssize_t max_pages_per_rpc_store(struct kobject *kobj,
}
LUSTRE_RW_ATTR(max_pages_per_rpc);
+static ssize_t unstable_stats_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ struct obd_device *dev = container_of(kobj, struct obd_device,
+ obd_kobj);
+ struct client_obd *cli = &dev->u.cli;
+ int pages, mb;
+
+ pages = atomic_read(&cli->cl_unstable_count);
+ mb = (pages * PAGE_SIZE) >> 20;
+
+ return sprintf(buf, "unstable_pages: %8d\n"
+ "unstable_mb: %8d\n", pages, mb);
+}
+LUSTRE_RO_ATTR(unstable_stats);
+
LPROC_SEQ_FOPS_RO_TYPE(osc, connect_flags);
LPROC_SEQ_FOPS_RO_TYPE(osc, server_uuid);
LPROC_SEQ_FOPS_RO_TYPE(osc, conn_uuid);
@@ -802,6 +819,7 @@ static struct attribute *osc_attrs[] = {
&lustre_attr_max_pages_per_rpc.attr,
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_resend_count.attr,
+ &lustre_attr_unstable_stats.attr,
NULL,
};
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 5cd8eef..7d1c2c5 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1873,6 +1873,9 @@ void osc_dec_unstable_pages(struct ptlrpc_request *req)
atomic_sub(page_count, &cli->cl_cache->ccc_unstable_nr);
LASSERT(atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
+ atomic_sub(page_count, &cli->cl_unstable_count);
+ LASSERT(atomic_read(&cli->cl_unstable_count) >= 0);
+
atomic_sub(page_count, &obd_unstable_pages);
LASSERT(atomic_read(&obd_unstable_pages) >= 0);
@@ -1904,6 +1907,9 @@ void osc_inc_unstable_pages(struct ptlrpc_request *req)
LASSERT(atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
atomic_add(page_count, &cli->cl_cache->ccc_unstable_nr);
+ LASSERT(atomic_read(&cli->cl_unstable_count) >= 0);
+ atomic_add(page_count, &cli->cl_unstable_count);
+
LASSERT(atomic_read(&obd_unstable_pages) >= 0);
atomic_add(page_count, &obd_unstable_pages);
--
1.7.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/15] patches missing from lustre 2.5.51 James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 06/15] staging: lustre: ldlm: clean up l_flags James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 13/15] staging: lustre: osc: Track number of "unstable" pages per osc James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 15/15] staging: lustre: ptlrpc: quiet warning for 2.1/2.5 connections James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 07/15] staging: lustre: ldlm: remove code wireshark handling James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 05/15] staging: lustre: ldlm: use accessor macros for l_flags James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
Re: [PATCH 05/15] staging: lustre: ldlm: use accessor macros for l_flags Bruce Korb <bruce.korb@gmail.com> - 2016-04-28 01:00 +0200
Re: [PATCH 05/15] staging: lustre: ldlm: use accessor macros for l_flags Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-28 10:30 +0200
[PATCH 14/15] staging: lustre: osc: Use SOFT_SYNC to urge server commit James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 04/15] staging: lustre: lmv: kernel crash due to misconfigured MDT James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 01/15] staging: lustre: llite: reset writeback index in ll_writepages James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 02/15] staging: lustre: llite: NFS reexport issue James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
[PATCH 09/15] staging: lustre: llite: Replace printing of i_ino with ll_inode2fid() James Simmons <jsimmons@infradead.org> - 2016-04-28 00:30 +0200
csiph-web