From: Andreas Gruenbacher Date: Mon, 22 Feb 2021 20:22:16 +0000 (+0100) Subject: Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git.kernel.org... X-Git-Tag: v5.15~1665^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=803074ad77b91e270c1ce90793a924cdb4547162;p=platform%2Fkernel%2Flinux-starfive.git Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git./linux/kernel/git/gfs2/linux-gfs2.git Merge the resource group glock sharing feature and the revoke accounting rework. Signed-off-by: Andreas Gruenbacher --- 803074ad77b91e270c1ce90793a924cdb4547162 diff --cc fs/gfs2/log.c index d3fa14e,2e93140,68e7afd..a6fbde9 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@@@ -549,43 -549,43 -661,16 +661,16 @@@@ static unsigned int calc_reserved(struc return reserved; } -- static unsigned int current_tail(struct gfs2_sbd *sdp) - { - struct gfs2_trans *tr; - unsigned int tail; - - spin_lock(&sdp->sd_ail_lock); - - if (list_empty(&sdp->sd_ail1_list)) { - tail = sdp->sd_log_head; - } else { - tr = list_last_entry(&sdp->sd_ail1_list, struct gfs2_trans, - tr_list); - tail = tr->tr_first; - } - - spin_unlock(&sdp->sd_ail_lock); - - return tail; - } - - static void log_pull_tail(struct gfs2_sbd *sdp, unsigned int new_tail) ++ static void log_pull_tail(struct gfs2_sbd *sdp) { - struct gfs2_trans *tr; - unsigned int tail; - - spin_lock(&sdp->sd_ail_lock); - - if (list_empty(&sdp->sd_ail1_list)) { - tail = sdp->sd_log_head; - } else { - tr = list_last_entry(&sdp->sd_ail1_list, struct gfs2_trans, - tr_list); - tail = tr->tr_first; - } - - spin_unlock(&sdp->sd_ail_lock); - - return tail; - } - - static void log_pull_tail(struct gfs2_sbd *sdp, unsigned int new_tail) - { -- unsigned int dist = log_distance(sdp, new_tail, sdp->sd_log_tail); ++ unsigned int new_tail = sdp->sd_log_flush_tail; ++ unsigned int dist; ++ if (new_tail == sdp->sd_log_tail) ++ return; ++ dist = log_distance(sdp, new_tail, sdp->sd_log_tail); ail2_empty(sdp, new_tail); -- -- atomic_add(dist, &sdp->sd_log_blks_free); -- trace_gfs2_log_blocks(sdp, dist); -- gfs2_assert_withdraw(sdp, atomic_read(&sdp->sd_log_blks_free) <= -- sdp->sd_jdesc->jd_blocks); -- ++ gfs2_log_release(sdp, dist); sdp->sd_log_tail = new_tail; } @@@@ -822,10 -822,10 -883,8 +883,8 @@@@ void gfs2_write_log_header(struct gfs2_ sb->s_blocksize - LH_V1_SIZE - 4); lh->lh_crc = cpu_to_be32(crc); -- gfs2_log_write(sdp, page, sb->s_blocksize, 0, dblock); -- gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags); - out: - log_flush_wait(sdp); ++ gfs2_log_write(sdp, jd, page, sb->s_blocksize, 0, dblock); ++ gfs2_log_submit_bio(&jd->jd_log_bio, REQ_OP_WRITE | op_flags); - out: - log_flush_wait(sdp); } /** @@@@ -1004,10 -1004,11 -1086,9 +1086,8 @@@@ repeat goto out_withdraw; if (sdp->sd_log_head != sdp->sd_log_flush_head) { -- log_flush_wait(sdp); log_write_header(sdp, flags); -- } else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle){ -- atomic_dec(&sdp->sd_log_blks_free); /* Adjust for unreserved buffer */ -- trace_gfs2_log_blocks(sdp, -1); ++ } else if (sdp->sd_log_tail != sdp->sd_log_flush_tail && !sdp->sd_log_idle) { log_write_header(sdp, flags); } if (gfs2_withdrawn(sdp)) diff --cc fs/gfs2/super.c index 754ea2a,e138a2d,f188277..7aa602a --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@@@ -620,15 -652,18 -645,18 +613,15 @@@@ int gfs2_make_fs_ro(struct gfs2_sbd *sd gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_SHUTDOWN | GFS2_LFC_MAKE_FS_RO); -- wait_event(sdp->sd_reserving_log_wait, -- atomic_read(&sdp->sd_reserving_log) == 0); -- gfs2_assert_warn(sdp, atomic_read(&sdp->sd_log_blks_free) == -- sdp->sd_jdesc->jd_blocks); ++ wait_event_timeout(sdp->sd_log_waitq, ++ gfs2_log_is_empty(sdp), ++ HZ * 5); ++ gfs2_assert_warn(sdp, gfs2_log_is_empty(sdp)); } else { -- wait_event_timeout(sdp->sd_reserving_log_wait, -- atomic_read(&sdp->sd_reserving_log) == 0, ++ wait_event_timeout(sdp->sd_log_waitq, ++ gfs2_log_is_empty(sdp), HZ * 5); } -- if (gfs2_holder_initialized(&freeze_gh)) -- gfs2_glock_dq_uninit(&freeze_gh); -- gfs2_quota_cleanup(sdp); if (!log_write_allowed)