Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312577 Details for
Bug 455940
GFS2: hang running consistency test.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Another attempt at trying to work out whats going on
test4.diff (text/plain), 9.44 KB, created by
Steve Whitehouse
on 2008-07-24 16:12:54 UTC
(
hide
)
Description:
Another attempt at trying to work out whats going on
Filename:
MIME Type:
Creator:
Steve Whitehouse
Created:
2008-07-24 16:12:54 UTC
Size:
9.44 KB
patch
obsolete
>diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c >index 4cbb695..81a5870 100644 >--- a/fs/gfs2/glock.c >+++ b/fs/gfs2/glock.c >@@ -397,9 +397,19 @@ static void state_change(struct gfs2_glock *gl, unsigned int new_state) > static void gfs2_demote_wake(struct gfs2_glock *gl) > { > gl->gl_demote_state = LM_ST_EXCLUSIVE; >- clear_bit(GLF_DEMOTE, &gl->gl_flags); >+ clear_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags); >+ clear_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags); > smp_mb__after_clear_bit(); >- wake_up_bit(&gl->gl_flags, GLF_DEMOTE); >+ wake_up_bit(&gl->gl_flags, GLF_LOCAL_DEMOTE); >+} >+ >+static unsigned int gfs2_demote_target(const struct gfs2_glock *gl) >+{ >+ if (test_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags)) >+ return LM_ST_UNLOCKED; >+ if (test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) >+ return gl->gl_demote_state; >+ return LM_ST_EXCLUSIVE; > } > > /** >@@ -420,9 +430,8 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret) > gh = find_first_waiter(gl); > > /* Demote to UN request arrived during demote to SH or DF */ >- if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags) && >- state != LM_ST_UNLOCKED && gl->gl_demote_state == LM_ST_UNLOCKED) >- gl->gl_target = LM_ST_UNLOCKED; >+ if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) >+ gl->gl_target = gfs2_demote_target(gl); > > /* Check for state != intended state */ > if (unlikely(state != gl->gl_target)) { >@@ -568,6 +577,14 @@ static inline struct gfs2_holder *find_first_holder(const struct gfs2_glock *gl) > return NULL; > } > >+static int require_demote(const struct gfs2_glock *gl) >+{ >+ unsigned long holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; >+ return (test_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags)) || >+ (test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags) && >+ time_after(jiffies, holdtime)); >+} >+ > /** > * run_queue - do all outstanding tasks related to a glock > * @gl: The glock in question >@@ -584,20 +601,19 @@ static void run_queue(struct gfs2_glock *gl, const int nonblock) > > GLOCK_BUG_ON(gl, test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)); > >- if (test_bit(GLF_DEMOTE, &gl->gl_flags) && >- gl->gl_demote_state != gl->gl_state) { >+ if (require_demote(gl)) { > if (find_first_holder(gl)) > goto out; > if (nonblock) > goto out_sched; > set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); >- GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); >- gl->gl_target = gl->gl_demote_state; >+ gl->gl_target = gfs2_demote_target(gl); >+ GLOCK_BUG_ON(gl, gl->gl_target == LM_ST_EXCLUSIVE); > } else { >- if (test_bit(GLF_DEMOTE, &gl->gl_flags)) >- gfs2_demote_wake(gl); > if (do_promote(gl) == 0) > goto out; >+ if (test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) >+ goto out; > gh = find_first_waiter(gl); > gl->gl_target = gh->gh_state; > if (!(gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) >@@ -617,21 +633,20 @@ out: > static void glock_work_func(struct work_struct *work) > { > unsigned long delay = 0; >+ unsigned long holdtime; > struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work); > > if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) > finish_xmote(gl, gl->gl_reply); > spin_lock(&gl->gl_spin); >- if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && >- gl->gl_state != LM_ST_UNLOCKED && >- gl->gl_demote_state != LM_ST_EXCLUSIVE) { >- unsigned long holdtime, now = jiffies; >+ run_queue(gl, 0); >+ if (test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) { >+ unsigned long now = jiffies; > holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; >+ delay = 1; > if (time_before(now, holdtime)) > delay = holdtime - now; >- set_bit(delay ? GLF_PENDING_DEMOTE : GLF_DEMOTE, &gl->gl_flags); > } >- run_queue(gl, 0); > spin_unlock(&gl->gl_spin); > if (!delay || > queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) >@@ -807,34 +822,7 @@ static void wait_on_holder(struct gfs2_holder *gh) > static void wait_on_demote(struct gfs2_glock *gl) > { > might_sleep(); >- wait_on_bit(&gl->gl_flags, GLF_DEMOTE, just_schedule, TASK_UNINTERRUPTIBLE); >-} >- >-/** >- * handle_callback - process a demote request >- * @gl: the glock >- * @state: the state the caller wants us to change to >- * >- * There are only two requests that we are going to see in actual >- * practise: LM_ST_SHARED and LM_ST_UNLOCKED >- */ >- >-static void handle_callback(struct gfs2_glock *gl, unsigned int state, >- int remote, unsigned long delay) >-{ >- int bit = delay ? GLF_PENDING_DEMOTE : GLF_DEMOTE; >- >- set_bit(bit, &gl->gl_flags); >- if (gl->gl_demote_state == LM_ST_EXCLUSIVE) { >- gl->gl_demote_state = state; >- gl->gl_demote_time = jiffies; >- if (remote && gl->gl_ops->go_type == LM_TYPE_IOPEN && >- gl->gl_object) >- gfs2_glock_schedule_for_reclaim(gl); >- } else if (gl->gl_demote_state != LM_ST_UNLOCKED && >- gl->gl_demote_state != state) { >- gl->gl_demote_state = LM_ST_UNLOCKED; >- } >+ wait_on_bit(&gl->gl_flags, GLF_LOCAL_DEMOTE, just_schedule, TASK_UNINTERRUPTIBLE); > } > > /** >@@ -998,7 +986,7 @@ void gfs2_glock_dq(struct gfs2_holder *gh) > > spin_lock(&gl->gl_spin); > if (gh->gh_flags & GL_NOCACHE) >- handle_callback(gl, LM_ST_UNLOCKED, 0, 0); >+ set_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags); > > list_del_init(&gh->gh_list); > if (find_first_holder(gl) == NULL) { >@@ -1011,8 +999,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh) > } > gl->gl_stamp = jiffies; > if (list_empty(&gl->gl_holders) && >- !test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && >- !test_bit(GLF_DEMOTE, &gl->gl_flags)) >+ !test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags) && >+ !test_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags)) > fast_path = 1; > } > spin_unlock(&gl->gl_spin); >@@ -1020,8 +1008,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh) > return; > > gfs2_glock_hold(gl); >- if (test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && >- !test_bit(GLF_DEMOTE, &gl->gl_flags)) >+ if (test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags) && >+ !test_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags)) > delay = gl->gl_ops->go_min_hold_time; > if (queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) > gfs2_glock_put(gl); >@@ -1267,7 +1255,15 @@ static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name, > delay = holdtime - now; > > spin_lock(&gl->gl_spin); >- handle_callback(gl, state, 1, delay); >+ if (!test_and_set_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) { >+ gl->gl_demote_time = now; >+ GLOCK_BUG_ON(gl, gl->gl_demote_state != LM_ST_EXCLUSIVE); >+ gl->gl_demote_state = state; >+ if (gl->gl_ops->go_type == LM_TYPE_IOPEN && gl->gl_object) >+ gfs2_glock_schedule_for_reclaim(gl); >+ } else if (gl->gl_demote_state != state) { >+ gl->gl_demote_state = LM_ST_UNLOCKED; >+ } > spin_unlock(&gl->gl_spin); > if (queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) > gfs2_glock_put(gl); >@@ -1401,7 +1397,7 @@ void gfs2_reclaim_glock(struct gfs2_sbd *sdp) > spin_lock(&gl->gl_spin); > if (find_first_holder(gl) == NULL && > gl->gl_state != LM_ST_UNLOCKED && demote_ok(gl)) { >- handle_callback(gl, LM_ST_UNLOCKED, 0, 0); >+ set_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags); > done_callback = 1; > } > spin_unlock(&gl->gl_spin); >@@ -1498,7 +1494,7 @@ static void clear_glock(struct gfs2_glock *gl) > > spin_lock(&gl->gl_spin); > if (find_first_holder(gl) == NULL && gl->gl_state != LM_ST_UNLOCKED) >- handle_callback(gl, LM_ST_UNLOCKED, 0, 0); >+ set_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags); > spin_unlock(&gl->gl_spin); > gfs2_glock_hold(gl); > if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) >@@ -1625,9 +1621,9 @@ static const char *gflags2str(char *buf, const unsigned long *gflags) > *p++ = 'l'; > if (test_bit(GLF_STICKY, gflags)) > *p++ = 's'; >- if (test_bit(GLF_DEMOTE, gflags)) >+ if (test_bit(GLF_LOCAL_DEMOTE, gflags)) > *p++ = 'D'; >- if (test_bit(GLF_PENDING_DEMOTE, gflags)) >+ if (test_bit(GLF_REMOTE_DEMOTE, gflags)) > *p++ = 'd'; > if (test_bit(GLF_DEMOTE_IN_PROGRESS, gflags)) > *p++ = 'p'; >@@ -1671,7 +1667,7 @@ static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl) > > dtime = jiffies - gl->gl_demote_time; > dtime *= 1000000/HZ; /* demote time in uSec */ >- if (!test_bit(GLF_DEMOTE, &gl->gl_flags)) >+ if (!test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) > dtime = 0; > gfs2_print_dbg(seq, "G: s:%s n:%u/%llu f:%s t:%s d:%s/%llu l:%d a:%d r:%d\n", > state2str(gl->gl_state), >diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h >index 971d92a..930a6c3 100644 >--- a/fs/gfs2/glock.h >+++ b/fs/gfs2/glock.h >@@ -67,11 +67,8 @@ static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl) > > static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl) > { >- int ret; >- spin_lock(&gl->gl_spin); >- ret = test_bit(GLF_DEMOTE, &gl->gl_flags); >- spin_unlock(&gl->gl_spin); >- return ret; >+ return test_bit(GLF_LOCAL_DEMOTE, &gl->gl_flags) || >+ test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags); > } > > int gfs2_glock_get(struct gfs2_sbd *sdp, >diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h >index 448697a..ee787e1 100644 >--- a/fs/gfs2/incore.h >+++ b/fs/gfs2/incore.h >@@ -160,8 +160,8 @@ struct gfs2_holder { > enum { > GLF_LOCK = 1, > GLF_STICKY = 2, >- GLF_DEMOTE = 3, >- GLF_PENDING_DEMOTE = 4, >+ GLF_LOCAL_DEMOTE = 3, >+ GLF_REMOTE_DEMOTE = 4, > GLF_DEMOTE_IN_PROGRESS = 5, > GLF_DIRTY = 6, > GLF_LFLUSH = 7, >diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c >index f66ea0f..9e47e34 100644 >--- a/fs/gfs2/ops_super.c >+++ b/fs/gfs2/ops_super.c >@@ -301,7 +301,7 @@ static void gfs2_drop_inode(struct inode *inode) > > if (test_bit(GIF_USER, &ip->i_flags) && inode->i_nlink) { > struct gfs2_glock *gl = ip->i_iopen_gh.gh_gl; >- if (gl && test_bit(GLF_DEMOTE, &gl->gl_flags)) >+ if (gl && test_bit(GLF_REMOTE_DEMOTE, &gl->gl_flags)) > clear_nlink(inode); > } > generic_drop_inode(inode);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 455940
:
312277
|
312369
|
312492
|
312577
|
312596
|
312646
|
312657