* GFS2: Pre-pull patch posting (fixes)
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are the current set of small fixes relating to GFS2.
This patch set contains two minor docs/spelling fixes, some fixes for
flock, a change to use GFP_NOFS to avoid recursion on a rarely used code
path and a fix for a race relating to the glock lru,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (fixes)
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Here are the current set of small fixes relating to GFS2.
This patch set contains two minor docs/spelling fixes, some fixes for
flock, a change to use GFP_NOFS to avoid recursion on a rarely used code
path and a fix for a race relating to the glock lru,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH 1/8] GFS2: Only wait for demote when last holder is dequeued
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Bob Peterson, Steven Whitehouse
From: Bob Peterson <rpeterso@redhat.com>
Function gfs2_glock_dq_wait is supposed to dequeue a glock and then
wait for the lock to be demoted. The problem is, if this is a shared
lock, its demote will depend on the other holders, which means you
might end up waiting forever because the other process is blocked.
This problem is especially apparent when dealing with nested flocks.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c355f73..278fae5 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1128,7 +1128,9 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl;
gfs2_glock_dq(gh);
might_sleep();
- wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
+ if (!find_first_holder(gl))
+ wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
+ TASK_UNINTERRUPTIBLE);
}
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 1/8] GFS2: Only wait for demote when last holder is dequeued
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Bob Peterson <rpeterso@redhat.com>
Function gfs2_glock_dq_wait is supposed to dequeue a glock and then
wait for the lock to be demoted. The problem is, if this is a shared
lock, its demote will depend on the other holders, which means you
might end up waiting forever because the other process is blocked.
This problem is especially apparent when dealing with nested flocks.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c355f73..278fae5 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1128,7 +1128,9 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl;
gfs2_glock_dq(gh);
might_sleep();
- wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
+ if (!find_first_holder(gl))
+ wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
+ TASK_UNINTERRUPTIBLE);
}
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 2/8] GFS2: Fix race in glock lru glock disposal
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Steven Whitehouse
We must not leave items on the LRU list with GLF_LOCK set, since
they can be removed if the glock is brought back into use, which
may then potentially result in a hang, waiting for GLF_LOCK to
clear.
It doesn't happen very often, since it requires a glock that has
not been used for a long time to be brought back into use at the
same moment that the shrinker is part way through disposing of
glocks.
The fix is to set GLF_LOCK at a later time, when we already know
that the other locks can be obtained. Also, we now only release
the lru_lock in case a resched is needed, rather than on every
iteration.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 278fae5..c1e5b12 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1406,12 +1406,16 @@ __acquires(&lru_lock)
gl = list_entry(list->next, struct gfs2_glock, gl_lru);
list_del_init(&gl->gl_lru);
if (!spin_trylock(&gl->gl_spin)) {
+add_back_to_lru:
list_add(&gl->gl_lru, &lru_list);
atomic_inc(&lru_count);
continue;
}
+ if (test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
+ spin_unlock(&gl->gl_spin);
+ goto add_back_to_lru;
+ }
clear_bit(GLF_LRU, &gl->gl_flags);
- spin_unlock(&lru_lock);
gl->gl_lockref.count++;
if (demote_ok(gl))
handle_callback(gl, LM_ST_UNLOCKED, 0, false);
@@ -1419,7 +1423,7 @@ __acquires(&lru_lock)
if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
gl->gl_lockref.count--;
spin_unlock(&gl->gl_spin);
- spin_lock(&lru_lock);
+ cond_resched_lock(&lru_lock);
}
}
@@ -1444,7 +1448,7 @@ static long gfs2_scan_glock_lru(int nr)
gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru);
/* Test for being demotable */
- if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
+ if (!test_bit(GLF_LOCK, &gl->gl_flags)) {
list_move(&gl->gl_lru, &dispose);
atomic_dec(&lru_count);
freed++;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 2/8] GFS2: Fix race in glock lru glock disposal
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
We must not leave items on the LRU list with GLF_LOCK set, since
they can be removed if the glock is brought back into use, which
may then potentially result in a hang, waiting for GLF_LOCK to
clear.
It doesn't happen very often, since it requires a glock that has
not been used for a long time to be brought back into use at the
same moment that the shrinker is part way through disposing of
glocks.
The fix is to set GLF_LOCK at a later time, when we already know
that the other locks can be obtained. Also, we now only release
the lru_lock in case a resched is needed, rather than on every
iteration.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 278fae5..c1e5b12 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1406,12 +1406,16 @@ __acquires(&lru_lock)
gl = list_entry(list->next, struct gfs2_glock, gl_lru);
list_del_init(&gl->gl_lru);
if (!spin_trylock(&gl->gl_spin)) {
+add_back_to_lru:
list_add(&gl->gl_lru, &lru_list);
atomic_inc(&lru_count);
continue;
}
+ if (test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
+ spin_unlock(&gl->gl_spin);
+ goto add_back_to_lru;
+ }
clear_bit(GLF_LRU, &gl->gl_flags);
- spin_unlock(&lru_lock);
gl->gl_lockref.count++;
if (demote_ok(gl))
handle_callback(gl, LM_ST_UNLOCKED, 0, false);
@@ -1419,7 +1423,7 @@ __acquires(&lru_lock)
if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
gl->gl_lockref.count--;
spin_unlock(&gl->gl_spin);
- spin_lock(&lru_lock);
+ cond_resched_lock(&lru_lock);
}
}
@@ -1444,7 +1448,7 @@ static long gfs2_scan_glock_lru(int nr)
gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru);
/* Test for being demotable */
- if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
+ if (!test_bit(GLF_LOCK, &gl->gl_flags)) {
list_move(&gl->gl_lru, &dispose);
atomic_dec(&lru_count);
freed++;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 3/8] GFS2: Use GFP_NOFS when allocating glocks
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Steven Whitehouse
Normally GFP_KERNEL is ok here, but there is now a rarely used code path
relating to deallocation of unlinked inodes (in certain corner cases)
which if hit at times of memory shortage can cause recursion while
trying to free memory.
One solution would be to try and move the gfs2_glock_get() call so
that it is no longer called while another glock is held, but that
doesn't look at all easy, so GFP_NOFS is the best solution for the
time being.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c1e5b12..b703dcc 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -731,14 +731,14 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
cachep = gfs2_glock_aspace_cachep;
else
cachep = gfs2_glock_cachep;
- gl = kmem_cache_alloc(cachep, GFP_KERNEL);
+ gl = kmem_cache_alloc(cachep, GFP_NOFS);
if (!gl)
return -ENOMEM;
memset(&gl->gl_lksb, 0, sizeof(struct dlm_lksb));
if (glops->go_flags & GLOF_LVB) {
- gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL);
+ gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_NOFS);
if (!gl->gl_lksb.sb_lvbptr) {
kmem_cache_free(cachep, gl);
return -ENOMEM;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 3/8] GFS2: Use GFP_NOFS when allocating glocks
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
Normally GFP_KERNEL is ok here, but there is now a rarely used code path
relating to deallocation of unlinked inodes (in certain corner cases)
which if hit at times of memory shortage can cause recursion while
trying to free memory.
One solution would be to try and move the gfs2_glock_get() call so
that it is no longer called while another glock is held, but that
doesn't look at all easy, so GFP_NOFS is the best solution for the
time being.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c1e5b12..b703dcc 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -731,14 +731,14 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
cachep = gfs2_glock_aspace_cachep;
else
cachep = gfs2_glock_cachep;
- gl = kmem_cache_alloc(cachep, GFP_KERNEL);
+ gl = kmem_cache_alloc(cachep, GFP_NOFS);
if (!gl)
return -ENOMEM;
memset(&gl->gl_lksb, 0, sizeof(struct dlm_lksb));
if (glops->go_flags & GLOF_LVB) {
- gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL);
+ gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_NOFS);
if (!gl->gl_lksb.sb_lvbptr) {
kmem_cache_free(cachep, gl);
return -ENOMEM;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 4/8] GFS2: replace count*size kzalloc by kcalloc
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Fabian Frederick, Steven Whitehouse
From: Fabian Frederick <fabf@skynet.be>
kcalloc manages count*sizeof overflow.
Cc: cluster-devel@redhat.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 91f274d..4fafea1 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -1036,8 +1036,8 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
new_size = old_size + RECOVER_SIZE_INC;
- submit = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS);
- result = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS);
+ submit = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
+ result = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
if (!submit || !result) {
kfree(submit);
kfree(result);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 4/8] GFS2: replace count*size kzalloc by kcalloc
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Fabian Frederick <fabf@skynet.be>
kcalloc manages count*sizeof overflow.
Cc: cluster-devel at redhat.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 91f274d..4fafea1 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -1036,8 +1036,8 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
new_size = old_size + RECOVER_SIZE_INC;
- submit = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS);
- result = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS);
+ submit = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
+ result = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
if (!submit || !result) {
kfree(submit);
kfree(result);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 5/8] GFS2: Allow flocks to use normal glock dq rather than dq_wait
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Bob Peterson, Steven Whitehouse
From: Bob Peterson <rpeterso@redhat.com>
This patch allows flock glocks to use a non-blocking dequeue rather
than dq_wait. It also reverts the previous patch I had posted regarding
dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
this might avoid unforeseen side effects, and was therefore safer.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 4fc3a30..491e8e0 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
goto out;
flock_lock_file_wait(file,
&(struct file_lock){.fl_type = F_UNLCK});
- gfs2_glock_dq_wait(fl_gh);
+ gfs2_glock_dq(fl_gh);
gfs2_holder_reinit(state, flags, fl_gh);
} else {
error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr,
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b703dcc..ee4e04f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl;
gfs2_glock_dq(gh);
might_sleep();
- if (!find_first_holder(gl))
- wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
- TASK_UNINTERRUPTIBLE);
+ wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
}
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 5/8] GFS2: Allow flocks to use normal glock dq rather than dq_wait
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Bob Peterson <rpeterso@redhat.com>
This patch allows flock glocks to use a non-blocking dequeue rather
than dq_wait. It also reverts the previous patch I had posted regarding
dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
this might avoid unforeseen side effects, and was therefore safer.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 4fc3a30..491e8e0 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
goto out;
flock_lock_file_wait(file,
&(struct file_lock){.fl_type = F_UNLCK});
- gfs2_glock_dq_wait(fl_gh);
+ gfs2_glock_dq(fl_gh);
gfs2_holder_reinit(state, flags, fl_gh);
} else {
error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr,
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b703dcc..ee4e04f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl;
gfs2_glock_dq(gh);
might_sleep();
- if (!find_first_holder(gl))
- wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
- TASK_UNINTERRUPTIBLE);
+ wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
}
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 6/8] GFS2: Allow caching of glocks for flock
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Bob Peterson, Steven Whitehouse
From: Bob Peterson <rpeterso@redhat.com>
This patch removes the GLF_NOCACHE flag from the glocks associated with
flocks. There should be no good reason not to cache glocks for flocks:
they only force the glock to be demoted before they can be reacquired,
which can slow down performance and even cause glock hangs, especially
in cases where the flocks are held in Shared (SH) mode.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 491e8e0..26b3f95 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -981,7 +981,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
int error = 0;
state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
- flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE;
+ flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT;
mutex_lock(&fp->f_fl_mutex);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 6/8] GFS2: Allow caching of glocks for flock
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Bob Peterson <rpeterso@redhat.com>
This patch removes the GLF_NOCACHE flag from the glocks associated with
flocks. There should be no good reason not to cache glocks for flocks:
they only force the glock to be demoted before they can be reacquired,
which can slow down performance and even cause glock hangs, especially
in cases where the flocks are held in Shared (SH) mode.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 491e8e0..26b3f95 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -981,7 +981,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
int error = 0;
state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
- flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE;
+ flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT;
mutex_lock(&fp->f_fl_mutex);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 7/8] GFS2: memcontrol: Spelling s/invlidate/invalidate/
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Geert Uytterhoeven, Steven Whitehouse
From: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: cluster-devel@redhat.com
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index fc11007..2ffc67d 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -234,8 +234,8 @@ static void inode_go_sync(struct gfs2_glock *gl)
* inode_go_inval - prepare a inode glock to be released
* @gl: the glock
* @flags:
- *
- * Normally we invlidate everything, but if we are moving into
+ *
+ * Normally we invalidate everything, but if we are moving into
* LM_ST_DEFERRED from LM_ST_SHARED or LM_ST_EXCLUSIVE then we
* can keep hold of the metadata, since it won't have changed.
*
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 7/8] GFS2: memcontrol: Spelling s/invlidate/invalidate/
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: cluster-devel at redhat.com
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index fc11007..2ffc67d 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -234,8 +234,8 @@ static void inode_go_sync(struct gfs2_glock *gl)
* inode_go_inval - prepare a inode glock to be released
* @gl: the glock
* @flags:
- *
- * Normally we invlidate everything, but if we are moving into
+ *
+ * Normally we invalidate everything, but if we are moving into
* LM_ST_DEFERRED from LM_ST_SHARED or LM_ST_EXCLUSIVE then we
* can keep hold of the metadata, since it won't have changed.
*
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [PATCH 8/8] GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
@ 2014-07-18 10:37 ` Steven Whitehouse
-1 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel; +Cc: Fabian Frederick, Steven Whitehouse
From: Fabian Frederick <fabf@skynet.be>
Cc: cluster-devel@redhat.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index db629d1..f4cb9c0 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -337,7 +337,7 @@ static bool gfs2_unaligned_extlen(struct gfs2_rbm *rbm, u32 n_unaligned, u32 *le
/**
* gfs2_free_extlen - Return extent length of free blocks
- * @rbm: Starting position
+ * @rrbm: Starting position
* @len: Max length to check
*
* Starting at the block specified by the rbm, see how many free blocks
@@ -2522,7 +2522,7 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state)
/**
* gfs2_rlist_free - free a resource group list
- * @list: the list of resource groups
+ * @rlist: the list of resource groups
*
*/
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [Cluster-devel] [PATCH 8/8] GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes
@ 2014-07-18 10:37 ` Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-07-18 10:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Fabian Frederick <fabf@skynet.be>
Cc: cluster-devel at redhat.com
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index db629d1..f4cb9c0 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -337,7 +337,7 @@ static bool gfs2_unaligned_extlen(struct gfs2_rbm *rbm, u32 n_unaligned, u32 *le
/**
* gfs2_free_extlen - Return extent length of free blocks
- * @rbm: Starting position
+ * @rrbm: Starting position
* @len: Max length to check
*
* Starting at the block specified by the rbm, see how many free blocks
@@ -2522,7 +2522,7 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state)
/**
* gfs2_rlist_free - free a resource group list
- * @list: the list of resource groups
+ * @rlist: the list of resource groups
*
*/
--
1.8.3.1
^ permalink raw reply related [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2014-09-15 9:32 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-09-15 9:32 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a number of small fixes for GFS2. There is a fix for FIEMAP
on large sparse files, a negative dentry hashing fix, a fix for
flock, and a bug fix relating to d_splice_alias usage. There are
also (patches 1 and 5) a couple of updates which are less
critical, but small and low risk.
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2014-01-02 12:28 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2014-01-02 12:28 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here is a set of small fixes for GFS2. There is a fix to drop
s_umount which is copied in from the core vfs, two patches
relate to a hard to hit "use after free" and memory leak.
Two patches related to using DIO and buffered I/O on the same
file to ensure correct operation in relation to glock state
changes. The final patch adds an RCU read lock to ensure
correct locking on an error path,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2013-11-22 10:35 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2013-11-22 10:35 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a couple of very small, but important, fixes,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2013-08-19 8:48 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2013-08-19 8:48 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Out of these fives patches, the one for ensuring that the number of
revokes is not exceeded, and the one for checking the glock is not
already held in gfs2_getxattr are the two most important. The latter
can be triggered by selinux.
The other three patches are very small and fix mostly fairly
trivial issues,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2013-06-04 13:40 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2013-06-04 13:40 UTC (permalink / raw)
To: linux-kernel, cluster-devel
There are four patches this time. The first fixes a problem where the
wrong descriptor type was being written into the log for journaled data
blocks. The second fixes a race relating to the deallocation of allocator
data. The third provides a fallback if kmalloc is unable to satisfy a
request to allocate a directory hash table. The fourth fixes the iopen
glock caching so that inodes are deleted in a more timely manner after
rmdir/unlink,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2013-05-24 13:37 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2013-05-24 13:37 UTC (permalink / raw)
To: linux-kernel, cluster-devel
This time there are just four fixes. There are a couple of minor updates
to the quota code, a fix for KConfig to ensure that only valid combinations
including GFS2 can be built, and a fix for a typo affecting end i/o
processing when writing the journal.
Also, there is a temporary fix for a performance regression relating to
block reservations and directories. A longer fix will be applied in
due course, but this deals with the most immediate problem for now,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2012-11-07 10:15 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2012-11-07 10:15 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a number of GFS2 bug fixes. There are three from Andy Price
which fix various issues spotted by automated code analysis. There are two
from Lukas Czerner fixing my mistaken assumptions as to how FITRIM
should work. Finally Ben Marzinski has fixed a bug relating to mmap and
atime and also a bug relating to a locking issue in the transaction code.
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2012-09-13 9:42 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2012-09-13 9:42 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are three GFS2 fixes for the current kernel tree. These are all
related to the block reservation code which was added at the merge
window. That code will be getting an update at the forthcoming merge
window too. In the mean time though there are a few smaller issues
which should be fixed.
The first patch resolves an issue with write sizes of greater than
32 bits with the size hinting code. The second ensures that the
allocation data structure is initialised when using xattrs and the
third takes into account allocations which may have been made by
other nodes which affect a reservation on the local node,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2012-04-11 8:56 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2012-04-11 8:56 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are four fixes for issues that have come up since the last
merge window,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2012-02-28 11:11 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2012-02-28 11:11 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are four patches which provided fixes for bugs found in the
current upstream code. Please see individual patches for
descriptions,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2011-07-14 8:21 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2011-07-14 8:21 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
The following three fixes should help ensure that 3.0 is the best
release yet, GFS2-wise at least. I've had the first two queued for
some time waiting for the final one of this set. All three are relatively
short, although the third is a bit longer than the others, mainly
due to the extra comments added describing the inode eviction process,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2011-05-23 12:39 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2011-05-23 12:39 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a couple of small fixes which just missed the previous pull
request. Both fairly short and self-explanatory,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2011-04-19 8:40 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2011-04-19 8:40 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are four fixes for GFS2. See the individual patches for the detailed
descriptions,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2010-07-15 13:57 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2010-07-15 13:57 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a few small fixes for GFS2,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2010-05-25 8:21 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2010-05-25 8:21 UTC (permalink / raw)
To: cluster-devel, linux-kernel
Hi,
These are three important, but relatively small, bug fixes for GFS2.
The first prevents a kernel BUG triggering in a relatively unlikely
(but possible) scenario when a log flush caused by glock demotion
races with a log flush from some other initiator (e.g. fsync).
The second and third patches add extra conditions to two areas
of code. This makes their behaviour match ext3 in those cases,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2010-02-04 9:46 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2010-02-04 9:46 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Hi,
Here are a couple of patches which between them fix a problem where
occasionally it was possible for the GFS2 module to be unloaded
before all the glocks were deallocated, which, needless to say, made
the slab allocator unhappy,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2010-01-11 9:11 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2010-01-11 9:11 UTC (permalink / raw)
To: linux-kernel, cluster-devel
Here are four small fixes for GFS2. Assuming that nobody spots
any errors, I'll be sending a pull request for these shortly,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
* GFS2: Pre-pull patch posting (fixes)
@ 2009-07-30 13:45 Steven Whitehouse
0 siblings, 0 replies; 36+ messages in thread
From: Steven Whitehouse @ 2009-07-30 13:45 UTC (permalink / raw)
To: cluster-devel, linux-kernel
Hi,
Here is the current content of the GFS2 -fixes git tree. Nothing
very exciting this time... some fixes for issues we've
had relating to flushing glocks/memory usage, plus a couple of
other fixes relating to statfs and the timely removal of inodes
which have been unlinked on a remote node,
Steve.
^ permalink raw reply [flat|nested] 36+ messages in thread
end of thread, other threads:[~2014-09-15 9:33 UTC | newest]
Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18 10:37 GFS2: Pre-pull patch posting (fixes) Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 1/8] GFS2: Only wait for demote when last holder is dequeued Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 2/8] GFS2: Fix race in glock lru glock disposal Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 3/8] GFS2: Use GFP_NOFS when allocating glocks Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 4/8] GFS2: replace count*size kzalloc by kcalloc Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 5/8] GFS2: Allow flocks to use normal glock dq rather than dq_wait Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 6/8] GFS2: Allow caching of glocks for flock Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 7/8] GFS2: memcontrol: Spelling s/invlidate/invalidate/ Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
2014-07-18 10:37 ` [PATCH 8/8] GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes Steven Whitehouse
2014-07-18 10:37 ` [Cluster-devel] " Steven Whitehouse
-- strict thread matches above, loose matches on Subject: below --
2014-09-15 9:32 GFS2: Pre-pull patch posting (fixes) Steven Whitehouse
2014-01-02 12:28 Steven Whitehouse
2013-11-22 10:35 Steven Whitehouse
2013-08-19 8:48 Steven Whitehouse
2013-06-04 13:40 Steven Whitehouse
2013-05-24 13:37 Steven Whitehouse
2012-11-07 10:15 Steven Whitehouse
2012-09-13 9:42 Steven Whitehouse
2012-04-11 8:56 Steven Whitehouse
2012-02-28 11:11 Steven Whitehouse
2011-07-14 8:21 Steven Whitehouse
2011-05-23 12:39 Steven Whitehouse
2011-04-19 8:40 Steven Whitehouse
2010-07-15 13:57 Steven Whitehouse
2010-05-25 8:21 Steven Whitehouse
2010-02-04 9:46 Steven Whitehouse
2010-01-11 9:11 Steven Whitehouse
2009-07-30 13:45 Steven Whitehouse
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.