From mboxrd@z Thu Jan 1 00:00:00 1970 From: wcheng@sourceware.org Date: 26 Jun 2007 20:39:25 -0000 Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs glock.c Message-ID: <20070626203925.23437.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL45 Changes by: wcheng at sourceware.org 2007-06-26 20:39:25 Modified files: gfs-kernel/src/gfs: glock.c Log message: Bugzilla 245776: Previous CVS check-in did a last minute change with the way purge count was calculated. The intention was to trim glocks evenly across all the hash buckets and apparently the size of hash array was overlooked. It ends up with zero trimming count most of the time. Fix this oversight. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/glock.c.diff?cvsroot=cluster&only_with_tag=RHEL45&r1=1.20.2.5&r2=1.20.2.5.2.1 --- cluster/gfs-kernel/src/gfs/glock.c 2007/01/25 22:38:39 1.20.2.5 +++ cluster/gfs-kernel/src/gfs/glock.c 2007/06/26 20:39:24 1.20.2.5.2.1 @@ -2484,13 +2484,12 @@ static int examine_bucket(glock_examiner examiner, struct gfs_sbd *sdp, struct gfs_gl_hash_bucket *bucket, - unsigned int purge_nr) + unsigned int *purge_nr) { struct glock_plug plug; struct list_head *tmp; struct gfs_glock *gl; int entries; - unsigned int p_cnt=purge_nr; /* Add "plug" to end of bucket list, work back up list from there */ memset(&plug.gl_flags, 0, sizeof(unsigned long)); @@ -2531,7 +2530,7 @@ write_unlock(&bucket->hb_lock); - examiner(gl, &p_cnt); + examiner(gl, purge_nr); } } @@ -2641,12 +2640,11 @@ if (!sdp->sd_tune.gt_glock_purge) purge_nr = 0; else - purge_nr = (atomic_read(&sdp->sd_glock_count) - - atomic_read(&sdp->sd_glock_held_count)) * - sdp->sd_tune.gt_glock_purge / 100 / GFS_GL_HASH_SIZE; + purge_nr = atomic_read(&sdp->sd_glock_count) * + sdp->sd_tune.gt_glock_purge / 100; for (x = 0; x < GFS_GL_HASH_SIZE; x++) { - examine_bucket(scan_glock, sdp, &sdp->sd_gl_hash[x], purge_nr); + examine_bucket(scan_glock, sdp, &sdp->sd_gl_hash[x], &purge_nr); cond_resched(); } }