* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2013-02-19 10:07 Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 01/10] GFS2: Separate LRU scanning from shrinker Steven Whitehouse ` (9 more replies) 0 siblings, 10 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com This is one of the smallest collections of patches for the merge window for some time. There are some clean ups relating to the transaction code and the shrinker, which are mostly in preparation for further development, but also make the code much easier to follow in these areas. There is a patch which allows the use of ->writepages even in the default ordered write mode for all writebacks. This results in sending larger i/os to the block layer, and a subsequent increase in performance. It also reduces the number of different i/o paths by one. There is also a bug fix reinstating the withdraw ack system which somehow got lost when the lock modules were merged into GFS2. And thats all this time around, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 01/10] GFS2: Separate LRU scanning from shrinker 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 02/10] GFS2: Merge revoke adding functions Steven Whitehouse ` (8 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com This breaks out the LRU scanning function from the shrinker in preparation for adding other callers to the LRU scanner. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 992c5c0..3ad8fd3 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1376,23 +1376,19 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret) gfs2_glock_put(gl); } +/** + * gfs2_scan_glock_lru - Scan the LRU looking for locks to demote + * @nr: The number of entries to scan + * + */ -static int gfs2_shrink_glock_memory(struct shrinker *shrink, - struct shrink_control *sc) +static void gfs2_scan_glock_lru(int nr) { struct gfs2_glock *gl; int may_demote; int nr_skipped = 0; - int nr = sc->nr_to_scan; - gfp_t gfp_mask = sc->gfp_mask; LIST_HEAD(skipped); - if (nr == 0) - goto out; - - if (!(gfp_mask & __GFP_FS)) - return -1; - spin_lock(&lru_lock); while(nr && !list_empty(&lru_list)) { gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru); @@ -1425,7 +1421,17 @@ static int gfs2_shrink_glock_memory(struct shrinker *shrink, list_splice(&skipped, &lru_list); atomic_add(nr_skipped, &lru_count); spin_unlock(&lru_lock); -out: +} + +static int gfs2_shrink_glock_memory(struct shrinker *shrink, + struct shrink_control *sc) +{ + if (sc->nr_to_scan) { + if (!(sc->gfp_mask & __GFP_FS)) + return -1; + gfs2_scan_glock_lru(sc->nr_to_scan); + } + return (atomic_read(&lru_count) / 100) * sysctl_vfs_cache_pressure; } -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 02/10] GFS2: Merge revoke adding functions 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 01/10] GFS2: Separate LRU scanning from shrinker Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 03/10] GFS2: Split gfs2_trans_add_bh() into two Steven Whitehouse ` (7 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com This moves the lo_add function for revokes into trans.c, removing a function call and making the code easier to read. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 9ceccb1..9c80742 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -600,20 +600,6 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); } -static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) -{ - struct gfs2_glock *gl = bd->bd_gl; - struct gfs2_trans *tr; - - tr = current->journal_info; - tr->tr_touched = 1; - tr->tr_num_revoke++; - sdp->sd_log_num_revoke++; - atomic_inc(&gl->gl_revokes); - set_bit(GLF_LFLUSH, &gl->gl_flags); - list_add(&bd->bd_list, &sdp->sd_log_le_revoke); -} - static void revoke_lo_before_commit(struct gfs2_sbd *sdp) { struct gfs2_meta_header *mh; @@ -895,7 +881,6 @@ const struct gfs2_log_operations gfs2_buf_lops = { }; const struct gfs2_log_operations gfs2_revoke_lops = { - .lo_add = revoke_lo_add, .lo_before_commit = revoke_lo_before_commit, .lo_after_commit = revoke_lo_after_commit, .lo_before_scan = revoke_lo_before_scan, diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 4136270..6f3ddbc 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -175,11 +175,19 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) { + struct gfs2_glock *gl = bd->bd_gl; + struct gfs2_trans *tr = current->journal_info; + BUG_ON(!list_empty(&bd->bd_list)); BUG_ON(!list_empty(&bd->bd_ail_st_list)); BUG_ON(!list_empty(&bd->bd_ail_gl_list)); lops_init_le(bd, &gfs2_revoke_lops); - lops_add(sdp, bd); + tr->tr_touched = 1; + tr->tr_num_revoke++; + sdp->sd_log_num_revoke++; + atomic_inc(&gl->gl_revokes); + set_bit(GLF_LFLUSH, &gl->gl_flags); + list_add(&bd->bd_list, &sdp->sd_log_le_revoke); } void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 03/10] GFS2: Split gfs2_trans_add_bh() into two 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 01/10] GFS2: Separate LRU scanning from shrinker Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 02/10] GFS2: Merge revoke adding functions Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 04/10] GFS2: Copy gfs2_trans_add_bh into new data/meta functions Steven Whitehouse ` (6 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com There is little common content in gfs2_trans_add_bh() between the data and meta classes by the time that the functions which it calls are taken into account. The intent here is to split this into two separate functions. Stage one is to introduce gfs2_trans_add_data() and gfs2_trans_add_meta() and update the callers accordingly. Later patches will then pull in the content of gfs2_trans_add_bh() and its dependent functions in order to clean up the code in this area. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 30de4f2..92340dd 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -51,7 +51,7 @@ static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page, continue; if (gfs2_is_jdata(ip)) set_buffer_uptodate(bh); - gfs2_trans_add_bh(ip->i_gl, bh, 0); + gfs2_trans_add_data(ip->i_gl, bh); } } @@ -852,7 +852,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, goto failed; } - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); if (gfs2_is_stuffed(ip)) return gfs2_stuffed_write_end(inode, dibh, pos, len, copied, page); diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index a68e91b..7a86275 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -93,7 +93,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, if (!gfs2_is_jdata(ip)) mark_buffer_dirty(bh); if (!gfs2_is_writeback(ip)) - gfs2_trans_add_bh(ip->i_gl, bh, 0); + gfs2_trans_add_data(ip->i_gl, bh); if (release) { unlock_page(page); @@ -153,7 +153,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) /* Set up the pointer to the new block */ - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); di = (struct gfs2_dinode *)dibh->b_data; gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); @@ -405,7 +405,7 @@ static inline __be64 *gfs2_indirect_init(struct metapath *mp, BUG_ON(i < 1); BUG_ON(mp->mp_bh[i] != NULL); mp->mp_bh[i] = gfs2_meta_new(gl, bn); - gfs2_trans_add_bh(gl, mp->mp_bh[i], 1); + gfs2_trans_add_meta(gl, mp->mp_bh[i]); gfs2_metatype_set(mp->mp_bh[i], GFS2_METATYPE_IN, GFS2_FORMAT_IN); gfs2_buffer_clear_tail(mp->mp_bh[i], sizeof(struct gfs2_meta_header)); ptr += offset; @@ -468,7 +468,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, BUG_ON(sheight < 1); BUG_ON(dibh == NULL); - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); if (height == sheight) { struct buffer_head *bh; @@ -544,7 +544,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, /* Branching from existing tree */ case ALLOC_GROW_DEPTH: if (i > 1 && i < height) - gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[i-1], 1); + gfs2_trans_add_meta(ip->i_gl, mp->mp_bh[i-1]); for (; i < height && n > 0; i++, n--) gfs2_indirect_init(mp, ip->i_gl, i, mp->mp_list[i-1], bn++); @@ -556,7 +556,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, case ALLOC_DATA: BUG_ON(n > dblks); BUG_ON(mp->mp_bh[end_of_metadata] == NULL); - gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[end_of_metadata], 1); + gfs2_trans_add_meta(ip->i_gl, mp->mp_bh[end_of_metadata]); dblks = n; ptr = metapointer(end_of_metadata, mp); dblock = bn; @@ -796,8 +796,8 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, down_write(&ip->i_rw_mutex); - gfs2_trans_add_bh(ip->i_gl, dibh, 1); - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); + gfs2_trans_add_meta(ip->i_gl, bh); bstart = 0; blen = 0; @@ -981,7 +981,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from) } if (!gfs2_is_writeback(ip)) - gfs2_trans_add_bh(ip->i_gl, bh, 0); + gfs2_trans_add_data(ip->i_gl, bh); zero_user(page, offset, length); mark_buffer_dirty(bh); @@ -1046,7 +1046,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) if (error) goto out; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); if (gfs2_is_stuffed(ip)) { gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode) + newsize); @@ -1141,7 +1141,7 @@ static int trunc_end(struct gfs2_inode *ip) ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -1246,7 +1246,7 @@ static int do_grow(struct inode *inode, u64 size) i_size_write(inode, size); ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 9a35670..7179478 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -93,7 +93,7 @@ int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, u64 block, struct buffer_head *bh; bh = gfs2_meta_new(ip->i_gl, block); - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD); gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); *bhp = bh; @@ -127,7 +127,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, if (error) return error; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); if (ip->i_inode.i_size < offset + size) i_size_write(&ip->i_inode, offset + size); @@ -209,7 +209,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, if (error) goto fail; - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); memcpy(bh->b_data + o, buf, amount); brelse(bh); @@ -231,7 +231,7 @@ out: i_size_write(&ip->i_inode, offset + copied); ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -647,7 +647,7 @@ static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh, return; } - gfs2_trans_add_bh(dip->i_gl, bh, 1); + gfs2_trans_add_meta(dip->i_gl, bh); /* If there is no prev entry, this is the first entry in the block. The de_rec_len is already as big as it needs to be. Just zero @@ -690,7 +690,7 @@ static struct gfs2_dirent *gfs2_init_dirent(struct inode *inode, offset = GFS2_DIRENT_SIZE(be16_to_cpu(dent->de_name_len)); totlen = be16_to_cpu(dent->de_rec_len); BUG_ON(offset + name->len > totlen); - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); ndent = (struct gfs2_dirent *)((char *)dent + offset); dent->de_rec_len = cpu_to_be16(offset); gfs2_qstr2dirent(name, totlen - offset, ndent); @@ -831,7 +831,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, return NULL; gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1); - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); gfs2_metatype_set(bh, GFS2_METATYPE_LF, GFS2_FORMAT_LF); leaf = (struct gfs2_leaf *)bh->b_data; leaf->lf_depth = cpu_to_be16(depth); @@ -916,7 +916,7 @@ static int dir_make_exhash(struct inode *inode) /* We're done with the new leaf block, now setup the new hash table. */ - gfs2_trans_add_bh(dip->i_gl, dibh, 1); + gfs2_trans_add_meta(dip->i_gl, dibh); gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); lp = (__be64 *)(dibh->b_data + sizeof(struct gfs2_dinode)); @@ -976,7 +976,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) return 1; /* can't split */ } - gfs2_trans_add_bh(dip->i_gl, obh, 1); + gfs2_trans_add_meta(dip->i_gl, obh); nleaf = new_leaf(inode, &nbh, be16_to_cpu(oleaf->lf_depth) + 1); if (!nleaf) { @@ -1069,7 +1069,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) error = gfs2_meta_inode_buffer(dip, &dibh); if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { - gfs2_trans_add_bh(dip->i_gl, dibh, 1); + gfs2_trans_add_meta(dip->i_gl, dibh); gfs2_add_inode_blocks(&dip->i_inode, 1); gfs2_dinode_out(dip, dibh->b_data); brelse(dibh); @@ -1622,7 +1622,7 @@ static int dir_new_leaf(struct inode *inode, const struct qstr *name) return error; } while(1); - gfs2_trans_add_bh(ip->i_gl, obh, 1); + gfs2_trans_add_meta(ip->i_gl, obh); leaf = new_leaf(inode, &bh, be16_to_cpu(oleaf->lf_depth)); if (!leaf) { @@ -1636,7 +1636,7 @@ static int dir_new_leaf(struct inode *inode, const struct qstr *name) error = gfs2_meta_inode_buffer(ip, &bh); if (error) return error; - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); gfs2_add_inode_blocks(&ip->i_inode, 1); gfs2_dinode_out(ip, bh->b_data); brelse(bh); @@ -1795,7 +1795,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, if (IS_ERR(dent)) return PTR_ERR(dent); - gfs2_trans_add_bh(dip->i_gl, bh, 1); + gfs2_trans_add_meta(dip->i_gl, bh); gfs2_inum_out(nip, dent); dent->de_type = cpu_to_be16(new_type); @@ -1804,7 +1804,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, error = gfs2_meta_inode_buffer(dip, &bh); if (error) return error; - gfs2_trans_add_bh(dip->i_gl, bh, 1); + gfs2_trans_add_meta(dip->i_gl, bh); } dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; @@ -1917,7 +1917,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, if (error) goto out_end_trans; - gfs2_trans_add_bh(dip->i_gl, dibh, 1); + gfs2_trans_add_meta(dip->i_gl, dibh); /* On the last dealloc, make this a regular file in case we crash. (We don't want to free these blocks a second time.) */ if (last_dealloc) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 991ab2d..06b7092 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -276,7 +276,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) error = gfs2_meta_inode_buffer(ip, &bh); if (error) goto out_trans_end; - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); ip->i_diskflags = new_flags; gfs2_dinode_out(ip, bh->b_data); brelse(bh); @@ -709,7 +709,7 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, if (unlikely(error)) return error; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); if (gfs2_is_stuffed(ip)) { error = gfs2_unstuff_dinode(ip, NULL); diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 2b6f569..db048a8 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -447,7 +447,7 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip, struct timespec tv = CURRENT_TIME; dibh = gfs2_meta_new(ip->i_gl, ip->i_no_addr); - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_metatype_set(dibh, GFS2_METATYPE_DI, GFS2_FORMAT_DI); gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); di = (struct gfs2_dinode *)dibh->b_data; @@ -584,7 +584,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name, if (error) goto fail_end_trans; set_nlink(&ip->i_inode, S_ISDIR(ip->i_inode.i_mode) ? 2 : 1); - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); return 0; @@ -931,7 +931,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, if (error) goto out_brelse; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); inc_nlink(&ip->i_inode); ip->i_inode.i_ctime = CURRENT_TIME; ihold(inode); @@ -1412,7 +1412,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, if (error) goto out_end_trans; ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index ae55e24..06122d0 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -590,7 +590,7 @@ static void do_qc(struct gfs2_quota_data *qd, s64 change) s64 x; mutex_lock(&sdp->sd_quota_mutex); - gfs2_trans_add_bh(ip->i_gl, qd->qd_bh, 1); + gfs2_trans_add_meta(ip->i_gl, qd->qd_bh); if (!test_bit(QDF_CHANGE, &qd->qd_flags)) { qc->qc_change = 0; @@ -726,7 +726,7 @@ get_a_page: goto unlock_out; } - gfs2_trans_add_bh(ip->i_gl, bh, 0); + gfs2_trans_add_meta(ip->i_gl, bh); kaddr = kmap_atomic(page); if (offset + sizeof(struct gfs2_quota) > PAGE_CACHE_SIZE) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index b7eff07..52c2aea 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1323,7 +1323,7 @@ int gfs2_fitrim(struct file *filp, void __user *argp) if (ret == 0) { bh = rgd->rd_bits[0].bi_bh; rgd->rd_flags |= GFS2_RGF_TRIMMED; - gfs2_trans_add_bh(rgd->rd_gl, bh, 1); + gfs2_trans_add_meta(rgd->rd_gl, bh); gfs2_rgrp_out(rgd, bh->b_data); gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, bh->b_data); gfs2_trans_end(sdp); @@ -1968,14 +1968,14 @@ static void gfs2_alloc_extent(const struct gfs2_rbm *rbm, bool dinode, *n = 1; block = gfs2_rbm_to_block(rbm); - gfs2_trans_add_bh(rbm->rgd->rd_gl, rbm->bi->bi_bh, 1); + gfs2_trans_add_meta(rbm->rgd->rd_gl, rbm->bi->bi_bh); gfs2_setbit(rbm, true, dinode ? GFS2_BLKST_DINODE : GFS2_BLKST_USED); block++; while (*n < elen) { ret = gfs2_rbm_from_block(&pos, block); if (ret || gfs2_testbit(&pos) != GFS2_BLKST_FREE) break; - gfs2_trans_add_bh(pos.rgd->rd_gl, pos.bi->bi_bh, 1); + gfs2_trans_add_meta(pos.rgd->rd_gl, pos.bi->bi_bh); gfs2_setbit(&pos, true, GFS2_BLKST_USED); (*n)++; block++; @@ -2014,7 +2014,7 @@ static struct gfs2_rgrpd *rgblk_free(struct gfs2_sbd *sdp, u64 bstart, rbm.bi->bi_bh->b_data + rbm.bi->bi_offset, rbm.bi->bi_len); } - gfs2_trans_add_bh(rbm.rgd->rd_gl, rbm.bi->bi_bh, 1); + gfs2_trans_add_meta(rbm.rgd->rd_gl, rbm.bi->bi_bh); gfs2_setbit(&rbm, false, new_state); } @@ -2157,7 +2157,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks, if (error == 0) { struct gfs2_dinode *di = (struct gfs2_dinode *)dibh->b_data; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); di->di_goal_meta = di->di_goal_data = cpu_to_be64(ip->i_goal); brelse(dibh); @@ -2176,7 +2176,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks, *generation = rbm.rgd->rd_igeneration++; } - gfs2_trans_add_bh(rbm.rgd->rd_gl, rbm.rgd->rd_bits[0].bi_bh, 1); + gfs2_trans_add_meta(rbm.rgd->rd_gl, rbm.rgd->rd_bits[0].bi_bh); gfs2_rgrp_out(rbm.rgd, rbm.rgd->rd_bits[0].bi_bh->b_data); gfs2_rgrp_ondisk2lvb(rbm.rgd->rd_rgl, rbm.rgd->rd_bits[0].bi_bh->b_data); @@ -2223,7 +2223,7 @@ void __gfs2_free_blocks(struct gfs2_inode *ip, u64 bstart, u32 blen, int meta) trace_gfs2_block_alloc(ip, rgd, bstart, blen, GFS2_BLKST_FREE); rgd->rd_free += blen; rgd->rd_flags &= ~GFS2_RGF_TRIMMED; - gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); + gfs2_trans_add_meta(rgd->rd_gl, rgd->rd_bits[0].bi_bh); gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, rgd->rd_bits[0].bi_bh->b_data); @@ -2260,7 +2260,7 @@ void gfs2_unlink_di(struct inode *inode) if (!rgd) return; trace_gfs2_block_alloc(ip, rgd, blkno, 1, GFS2_BLKST_UNLINKED); - gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); + gfs2_trans_add_meta(rgd->rd_gl, rgd->rd_bits[0].bi_bh); gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, rgd->rd_bits[0].bi_bh->b_data); update_rgrp_lvb_unlinked(rgd, 1); @@ -2281,7 +2281,7 @@ static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno) rgd->rd_dinodes--; rgd->rd_free++; - gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); + gfs2_trans_add_meta(rgd->rd_gl, rgd->rd_bits[0].bi_bh); gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, rgd->rd_bits[0].bi_bh->b_data); update_rgrp_lvb_unlinked(rgd, -1); diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index d648867..4dfda4c 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -500,7 +500,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, if (error) return; - gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); + gfs2_trans_add_meta(l_ip->i_gl, l_bh); spin_lock(&sdp->sd_statfs_spin); l_sc->sc_total += total; @@ -528,7 +528,7 @@ void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh, struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; - gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); + gfs2_trans_add_meta(l_ip->i_gl, l_bh); spin_lock(&sdp->sd_statfs_spin); m_sc->sc_total += l_sc->sc_total; @@ -539,7 +539,7 @@ void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh, 0, sizeof(struct gfs2_statfs_change)); spin_unlock(&sdp->sd_statfs_spin); - gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1); + gfs2_trans_add_meta(m_ip->i_gl, m_bh); gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode)); } @@ -824,7 +824,7 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) ret = gfs2_meta_inode_buffer(ip, &bh); if (ret == 0) { - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); gfs2_dinode_out(ip, bh->b_data); brelse(bh); } diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 6f3ddbc..cb795ac 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -150,7 +150,7 @@ void gfs2_trans_end(struct gfs2_sbd *sdp) * */ -void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) +static void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) { struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_bufdata *bd; @@ -173,6 +173,16 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) unlock_buffer(bh); } +void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) +{ + return gfs2_trans_add_bh(gl, bh, 0); +} + +void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) +{ + return gfs2_trans_add_bh(gl, bh, 1); +} + void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) { struct gfs2_glock *gl = bd->bd_gl; diff --git a/fs/gfs2/trans.h b/fs/gfs2/trans.h index bf2ae9a..1e6e7da 100644 --- a/fs/gfs2/trans.h +++ b/fs/gfs2/trans.h @@ -39,7 +39,8 @@ extern int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, unsigned int revokes); extern void gfs2_trans_end(struct gfs2_sbd *sdp); -extern void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta); +extern void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh); +extern void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh); extern void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd); extern void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len); diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 76c144b..cbb46c2 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -270,7 +270,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, if (error) goto out_gunlock; - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); dataptrs = GFS2_EA2DATAPTRS(ea); for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++) { @@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } @@ -509,7 +509,7 @@ static int gfs2_iter_unstuffed(struct gfs2_inode *ip, struct gfs2_ea_header *ea, } if (din) { - gfs2_trans_add_bh(ip->i_gl, bh[x], 1); + gfs2_trans_add_meta(ip->i_gl, bh[x]); memcpy(pos, din, cp_size); din += sdp->sd_jbsize; } @@ -629,7 +629,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) return error; gfs2_trans_add_unrevoke(sdp, block, 1); *bhp = gfs2_meta_new(ip->i_gl, block); - gfs2_trans_add_bh(ip->i_gl, *bhp, 1); + gfs2_trans_add_meta(ip->i_gl, *bhp); gfs2_metatype_set(*bhp, GFS2_METATYPE_EA, GFS2_FORMAT_EA); gfs2_buffer_clear_tail(*bhp, sizeof(struct gfs2_meta_header)); @@ -691,7 +691,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, return error; gfs2_trans_add_unrevoke(sdp, block, 1); bh = gfs2_meta_new(ip->i_gl, block); - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); gfs2_add_inode_blocks(&ip->i_inode, 1); @@ -751,7 +751,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } @@ -834,7 +834,7 @@ static void ea_set_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_header *prev = el->el_prev; u32 len; - gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); + gfs2_trans_add_meta(ip->i_gl, el->el_bh); if (!prev || !GFS2_EA_IS_STUFFED(ea)) { ea->ea_type = GFS2_EATYPE_UNUSED; @@ -872,7 +872,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, if (error) return error; - gfs2_trans_add_bh(ip->i_gl, bh, 1); + gfs2_trans_add_meta(ip->i_gl, bh); if (es->ea_split) ea = ea_split_ea(ea); @@ -886,7 +886,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, if (error) goto out; ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); out: @@ -901,7 +901,7 @@ static int ea_set_simple_alloc(struct gfs2_inode *ip, struct gfs2_ea_header *ea = es->es_ea; int error; - gfs2_trans_add_bh(ip->i_gl, es->es_bh, 1); + gfs2_trans_add_meta(ip->i_gl, es->es_bh); if (es->ea_split) ea = ea_split_ea(ea); @@ -997,7 +997,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, goto out; } - gfs2_trans_add_bh(ip->i_gl, indbh, 1); + gfs2_trans_add_meta(ip->i_gl, indbh); } else { u64 blk; unsigned int n = 1; @@ -1006,7 +1006,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, return error; gfs2_trans_add_unrevoke(sdp, blk, 1); indbh = gfs2_meta_new(ip->i_gl, blk); - gfs2_trans_add_bh(ip->i_gl, indbh, 1); + gfs2_trans_add_meta(ip->i_gl, indbh); gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); gfs2_buffer_clear_tail(indbh, mh_size); @@ -1092,7 +1092,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) if (error) return error; - gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); + gfs2_trans_add_meta(ip->i_gl, el->el_bh); if (prev) { u32 len; @@ -1109,7 +1109,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { ip->i_inode.i_ctime = CURRENT_TIME; - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } @@ -1265,7 +1265,7 @@ int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data) if (GFS2_EA_IS_STUFFED(el.el_ea)) { error = gfs2_trans_begin(sdp, RES_DINODE + RES_EATTR, 0); if (error == 0) { - gfs2_trans_add_bh(ip->i_gl, el.el_bh, 1); + gfs2_trans_add_meta(ip->i_gl, el.el_bh); memcpy(GFS2_EA2DATA(el.el_ea), data, GFS2_EA_DATA_LEN(el.el_ea)); } @@ -1352,7 +1352,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) if (error) goto out_gunlock; - gfs2_trans_add_bh(ip->i_gl, indbh, 1); + gfs2_trans_add_meta(ip->i_gl, indbh); eablk = (__be64 *)(indbh->b_data + sizeof(struct gfs2_meta_header)); bstart = 0; @@ -1384,7 +1384,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } @@ -1434,7 +1434,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip) error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { - gfs2_trans_add_bh(ip->i_gl, dibh, 1); + gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); } -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 04/10] GFS2: Copy gfs2_trans_add_bh into new data/meta functions 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (2 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 03/10] GFS2: Split gfs2_trans_add_bh() into two Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 05/10] GFS2: Merge gfs2_attach_bufdata() into trans.c Steven Whitehouse ` (5 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com This patch copies the body of gfs2_trans_add_bh into the two newly added gfs2_trans_add_data and gfs2_trans_add_meta functions. We can then move the .lo_add functions from lops.c into trans.c and call them directly. As a result of this, we no longer need to use the .lo_add functions at all, so that is removed from the log operations structure. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index c373a24..5d129ab 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -52,7 +52,6 @@ struct gfs2_log_header_host { */ struct gfs2_log_operations { - void (*lo_add) (struct gfs2_sbd *sdp, struct gfs2_bufdata *bd); void (*lo_before_commit) (struct gfs2_sbd *sdp); void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai); void (*lo_before_scan) (struct gfs2_jdesc *jd, diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 9c80742..a505597 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -37,7 +37,7 @@ * * The log lock must be held when calling this function */ -static void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh) +void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh) { struct gfs2_bufdata *bd; @@ -388,32 +388,6 @@ static struct page *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type, return page; } -static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) -{ - struct gfs2_meta_header *mh; - struct gfs2_trans *tr; - - tr = current->journal_info; - tr->tr_touched = 1; - if (!list_empty(&bd->bd_list)) - return; - set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); - set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); - mh = (struct gfs2_meta_header *)bd->bd_bh->b_data; - if (unlikely(mh->mh_magic != cpu_to_be32(GFS2_MAGIC))) { - printk(KERN_ERR - "Attempting to add uninitialised block to journal (inplace block=%lld)\n", - (unsigned long long)bd->bd_bh->b_blocknr); - BUG(); - } - gfs2_pin(sdp, bd->bd_bh); - mh->__pad0 = cpu_to_be64(0); - mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid); - sdp->sd_log_num_buf++; - list_add(&bd->bd_list, &sdp->sd_log_le_buf); - tr->tr_num_buf_new++; -} - static void gfs2_check_magic(struct buffer_head *bh) { void *kaddr; @@ -735,44 +709,6 @@ static void revoke_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) } /** - * databuf_lo_add - Add a databuf to the transaction. - * - * This is used in two distinct cases: - * i) In ordered write mode - * We put the data buffer on a list so that we can ensure that its - * synced to disk at the right time - * ii) In journaled data mode - * We need to journal the data block in the same way as metadata in - * the functions above. The difference is that here we have a tag - * which is two __be64's being the block number (as per meta data) - * and a flag which says whether the data block needs escaping or - * not. This means we need a new log entry for each 251 or so data - * blocks, which isn't an enormous overhead but twice as much as - * for normal metadata blocks. - */ -static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) -{ - struct gfs2_trans *tr = current->journal_info; - struct address_space *mapping = bd->bd_bh->b_page->mapping; - struct gfs2_inode *ip = GFS2_I(mapping->host); - - if (tr) - tr->tr_touched = 1; - if (!list_empty(&bd->bd_list)) - return; - set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); - set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); - if (gfs2_is_jdata(ip)) { - gfs2_pin(sdp, bd->bd_bh); - tr->tr_num_databuf_new++; - sdp->sd_log_num_databuf++; - list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); - } else { - list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); - } -} - -/** * databuf_lo_before_commit - Scan the data buffers, writing as we go * */ @@ -871,7 +807,6 @@ static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai) const struct gfs2_log_operations gfs2_buf_lops = { - .lo_add = buf_lo_add, .lo_before_commit = buf_lo_before_commit, .lo_after_commit = buf_lo_after_commit, .lo_before_scan = buf_lo_before_scan, @@ -894,7 +829,6 @@ const struct gfs2_log_operations gfs2_rg_lops = { }; const struct gfs2_log_operations gfs2_databuf_lops = { - .lo_add = databuf_lo_add, .lo_before_commit = databuf_lo_before_commit, .lo_after_commit = databuf_lo_after_commit, .lo_scan_elements = databuf_lo_scan_elements, diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index 954a330..d85b376 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h @@ -29,6 +29,7 @@ extern const struct gfs2_log_operations gfs2_databuf_lops; extern const struct gfs2_log_operations *gfs2_log_ops[]; extern void gfs2_log_write_page(struct gfs2_sbd *sdp, struct page *page); extern void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw); +extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh); static inline unsigned int buf_limit(struct gfs2_sbd *sdp) { @@ -53,12 +54,6 @@ static inline void lops_init_le(struct gfs2_bufdata *bd, bd->bd_ops = lops; } -static inline void lops_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) -{ - if (bd->bd_ops->lo_add) - bd->bd_ops->lo_add(sdp, bd); -} - static inline void lops_before_commit(struct gfs2_sbd *sdp) { int x; diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index cb795ac..1fbd57e 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -18,6 +18,7 @@ #include "gfs2.h" #include "incore.h" #include "glock.h" +#include "inode.h" #include "log.h" #include "lops.h" #include "meta_io.h" @@ -143,15 +144,46 @@ void gfs2_trans_end(struct gfs2_sbd *sdp) } /** - * gfs2_trans_add_bh - Add a to-be-modified buffer to the current transaction - * @gl: the glock the buffer belongs to - * @bh: The buffer to add - * @meta: True in the case of adding metadata + * databuf_lo_add - Add a databuf to the transaction. * + * This is used in two distinct cases: + * i) In ordered write mode + * We put the data buffer on a list so that we can ensure that its + * synced to disk at the right time + * ii) In journaled data mode + * We need to journal the data block in the same way as metadata in + * the functions above. The difference is that here we have a tag + * which is two __be64's being the block number (as per meta data) + * and a flag which says whether the data block needs escaping or + * not. This means we need a new log entry for each 251 or so data + * blocks, which isn't an enormous overhead but twice as much as + * for normal metadata blocks. */ +static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) +{ + struct gfs2_trans *tr = current->journal_info; + struct address_space *mapping = bd->bd_bh->b_page->mapping; + struct gfs2_inode *ip = GFS2_I(mapping->host); + + if (tr) + tr->tr_touched = 1; + if (!list_empty(&bd->bd_list)) + return; + set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); + set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); + if (gfs2_is_jdata(ip)) { + gfs2_pin(sdp, bd->bd_bh); + tr->tr_num_databuf_new++; + sdp->sd_log_num_databuf++; + list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); + } else { + list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); + } +} -static void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) +void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) { + struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_bufdata *bd; @@ -163,24 +195,64 @@ static void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int else { gfs2_log_unlock(sdp); unlock_buffer(bh); - gfs2_attach_bufdata(gl, bh, meta); + gfs2_attach_bufdata(gl, bh, 0); bd = bh->b_private; lock_buffer(bh); gfs2_log_lock(sdp); } - lops_add(sdp, bd); + databuf_lo_add(sdp, bd); gfs2_log_unlock(sdp); unlock_buffer(bh); } -void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) +static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) { - return gfs2_trans_add_bh(gl, bh, 0); + struct gfs2_meta_header *mh; + struct gfs2_trans *tr; + + tr = current->journal_info; + tr->tr_touched = 1; + if (!list_empty(&bd->bd_list)) + return; + set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); + set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); + mh = (struct gfs2_meta_header *)bd->bd_bh->b_data; + if (unlikely(mh->mh_magic != cpu_to_be32(GFS2_MAGIC))) { + printk(KERN_ERR + "Attempting to add uninitialised block to journal (inplace block=%lld)\n", + (unsigned long long)bd->bd_bh->b_blocknr); + BUG(); + } + gfs2_pin(sdp, bd->bd_bh); + mh->__pad0 = cpu_to_be64(0); + mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid); + sdp->sd_log_num_buf++; + list_add(&bd->bd_list, &sdp->sd_log_le_buf); + tr->tr_num_buf_new++; } void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) { - return gfs2_trans_add_bh(gl, bh, 1); + + struct gfs2_sbd *sdp = gl->gl_sbd; + struct gfs2_bufdata *bd; + + lock_buffer(bh); + gfs2_log_lock(sdp); + bd = bh->b_private; + if (bd) + gfs2_assert(sdp, bd->bd_gl == gl); + else { + gfs2_log_unlock(sdp); + unlock_buffer(bh); + gfs2_attach_bufdata(gl, bh, 1); + bd = bh->b_private; + lock_buffer(bh); + gfs2_log_lock(sdp); + } + meta_lo_add(sdp, bd); + gfs2_log_unlock(sdp); + unlock_buffer(bh); } void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 05/10] GFS2: Merge gfs2_attach_bufdata() into trans.c 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (3 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 04/10] GFS2: Copy gfs2_trans_add_bh into new data/meta functions Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 06/10] GFS2: Clean up freeze code Steven Whitehouse ` (4 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com The locking in gfs2_attach_bufdata() was type specific (data/meta) which made the function rather confusing. This patch moves the core of gfs2_attach_bufdata() into trans.c renaming it gfs2_alloc_bufdata() and moving the locking into gfs2_trans_add_data()/gfs2_trans_add_meta() As a result all of the locking related to adding data and metadata to the journal is now in these two functions. This should help to clarify what is going on, and give us some opportunities to simplify in some cases. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index d85b376..ba77b7d 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h @@ -47,13 +47,6 @@ static inline unsigned int databuf_limit(struct gfs2_sbd *sdp) return limit; } -static inline void lops_init_le(struct gfs2_bufdata *bd, - const struct gfs2_log_operations *lops) -{ - INIT_LIST_HEAD(&bd->bd_list); - bd->bd_ops = lops; -} - static inline void lops_before_commit(struct gfs2_sbd *sdp) { int x; diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 22255d9..b059bbb 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -271,41 +271,6 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh) return 0; } -/** - * gfs2_attach_bufdata - attach a struct gfs2_bufdata structure to a buffer - * @gl: the glock the buffer belongs to - * @bh: The buffer to be attached to - * @meta: Flag to indicate whether its metadata or not - */ - -void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, - int meta) -{ - struct gfs2_bufdata *bd; - - if (meta) - lock_page(bh->b_page); - - if (bh->b_private) { - if (meta) - unlock_page(bh->b_page); - return; - } - - bd = kmem_cache_zalloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL); - bd->bd_bh = bh; - bd->bd_gl = gl; - - if (meta) - lops_init_le(bd, &gfs2_buf_lops); - else - lops_init_le(bd, &gfs2_databuf_lops); - bh->b_private = bd; - - if (meta) - unlock_page(bh->b_page); -} - void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int meta) { struct address_space *mapping = bh->b_page->mapping; diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h index c30973b..0d4c843 100644 --- a/fs/gfs2/meta_io.h +++ b/fs/gfs2/meta_io.h @@ -56,9 +56,6 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh); struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create); -void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, - int meta); - void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int meta); diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 1fbd57e..14dbf6d 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -143,6 +143,21 @@ void gfs2_trans_end(struct gfs2_sbd *sdp) sb_end_intwrite(sdp->sd_vfs); } +static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl, + struct buffer_head *bh, + const struct gfs2_log_operations *lops) +{ + struct gfs2_bufdata *bd; + + bd = kmem_cache_zalloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL); + bd->bd_bh = bh; + bd->bd_gl = gl; + bd->bd_ops = lops; + INIT_LIST_HEAD(&bd->bd_list); + bh->b_private = bd; + return bd; +} + /** * databuf_lo_add - Add a databuf to the transaction. * @@ -190,16 +205,15 @@ void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) lock_buffer(bh); gfs2_log_lock(sdp); bd = bh->b_private; - if (bd) - gfs2_assert(sdp, bd->bd_gl == gl); - else { + if (bd == NULL) { gfs2_log_unlock(sdp); unlock_buffer(bh); - gfs2_attach_bufdata(gl, bh, 0); - bd = bh->b_private; + if (bh->b_private == NULL) + bd = gfs2_alloc_bufdata(gl, bh, &gfs2_databuf_lops); lock_buffer(bh); gfs2_log_lock(sdp); } + gfs2_assert(sdp, bd->bd_gl == gl); databuf_lo_add(sdp, bd); gfs2_log_unlock(sdp); unlock_buffer(bh); @@ -240,16 +254,17 @@ void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) lock_buffer(bh); gfs2_log_lock(sdp); bd = bh->b_private; - if (bd) - gfs2_assert(sdp, bd->bd_gl == gl); - else { + if (bd == NULL) { gfs2_log_unlock(sdp); unlock_buffer(bh); - gfs2_attach_bufdata(gl, bh, 1); - bd = bh->b_private; + lock_page(bh->b_page); + if (bh->b_private == NULL) + bd = gfs2_alloc_bufdata(gl, bh, &gfs2_buf_lops); + unlock_page(bh->b_page); lock_buffer(bh); gfs2_log_lock(sdp); } + gfs2_assert(sdp, bd->bd_gl == gl); meta_lo_add(sdp, bd); gfs2_log_unlock(sdp); unlock_buffer(bh); @@ -263,7 +278,7 @@ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) BUG_ON(!list_empty(&bd->bd_list)); BUG_ON(!list_empty(&bd->bd_ail_st_list)); BUG_ON(!list_empty(&bd->bd_ail_gl_list)); - lops_init_le(bd, &gfs2_revoke_lops); + bd->bd_ops = &gfs2_revoke_lops; tr->tr_touched = 1; tr->tr_num_revoke++; sdp->sd_log_num_revoke++; -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 06/10] GFS2: Clean up freeze code 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (4 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 05/10] GFS2: Merge gfs2_attach_bufdata() into trans.c Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 07/10] GFS2: Use ->writepages for ordered writes Steven Whitehouse ` (3 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com The freeze code has not been looked at a lot recently. Upstream has moved on, and this is an attempt to catch us back up again. There is a vfs level interface for the freeze code which can be called from our (obsolete, but kept for backward compatibility purposes) sysfs freeze interface. This means freezing this way vs. doing it from the ioctl should now work in identical fashion. As a result of this, the freeze function is only called once and we can drop our own special purpose code for counting the number of freezes. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 5d129ab..19750bc 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -757,10 +757,7 @@ struct gfs2_sbd { unsigned int sd_replayed_blocks; /* For quiescing the filesystem */ - struct gfs2_holder sd_freeze_gh; - struct mutex sd_freeze_lock; - unsigned int sd_freeze_count; char sd_fsname[GFS2_FSNAME_LEN]; char sd_table_name[GFS2_FSNAME_LEN]; diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 0e3554e..5f5aba5 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -115,8 +115,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) INIT_LIST_HEAD(&sdp->sd_revoke_list); - mutex_init(&sdp->sd_freeze_lock); - return sdp; } diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 4dfda4c..c075b62 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -663,54 +663,6 @@ out: return error; } -/** - * gfs2_freeze_fs - freezes the file system - * @sdp: the file system - * - * This function flushes data and meta data for all machines by - * acquiring the transaction log exclusively. All journals are - * ensured to be in a clean state as well. - * - * Returns: errno - */ - -int gfs2_freeze_fs(struct gfs2_sbd *sdp) -{ - int error = 0; - - mutex_lock(&sdp->sd_freeze_lock); - - if (!sdp->sd_freeze_count++) { - error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh); - if (error) - sdp->sd_freeze_count--; - } - - mutex_unlock(&sdp->sd_freeze_lock); - - return error; -} - -/** - * gfs2_unfreeze_fs - unfreezes the file system - * @sdp: the file system - * - * This function allows the file system to proceed by unlocking - * the exclusively held transaction lock. Other GFS2 nodes are - * now free to acquire the lock shared and go on with their lives. - * - */ - -void gfs2_unfreeze_fs(struct gfs2_sbd *sdp) -{ - mutex_lock(&sdp->sd_freeze_lock); - - if (sdp->sd_freeze_count && !--sdp->sd_freeze_count) - gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); - - mutex_unlock(&sdp->sd_freeze_lock); -} - void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) { struct gfs2_dinode *str = buf; @@ -888,13 +840,6 @@ static void gfs2_put_super(struct super_block *sb) int error; struct gfs2_jdesc *jd; - /* Unfreeze the filesystem, if we need to */ - - mutex_lock(&sdp->sd_freeze_lock); - if (sdp->sd_freeze_count) - gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); - mutex_unlock(&sdp->sd_freeze_lock); - /* No more recovery requests */ set_bit(SDF_NORECOVERY, &sdp->sd_flags); smp_mb(); @@ -985,7 +930,7 @@ static int gfs2_freeze(struct super_block *sb) return -EINVAL; for (;;) { - error = gfs2_freeze_fs(sdp); + error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh); if (!error) break; @@ -1013,7 +958,9 @@ static int gfs2_freeze(struct super_block *sb) static int gfs2_unfreeze(struct super_block *sb) { - gfs2_unfreeze_fs(sb->s_fs_info); + struct gfs2_sbd *sdp = sb->s_fs_info; + + gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); return 0; } diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h index a046468..90e3322 100644 --- a/fs/gfs2/super.h +++ b/fs/gfs2/super.h @@ -46,9 +46,6 @@ extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh, struct buffer_head *l_bh); extern int gfs2_statfs_sync(struct super_block *sb, int type); -extern int gfs2_freeze_fs(struct gfs2_sbd *sdp); -extern void gfs2_unfreeze_fs(struct gfs2_sbd *sdp); - extern struct file_system_type gfs2_fs_type; extern struct file_system_type gfs2meta_fs_type; extern const struct export_operations gfs2_export_ops; diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 8056b7b..462e841 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -91,19 +91,15 @@ static ssize_t uuid_show(struct gfs2_sbd *sdp, char *buf) static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) { - unsigned int count; - - mutex_lock(&sdp->sd_freeze_lock); - count = sdp->sd_freeze_count; - mutex_unlock(&sdp->sd_freeze_lock); + struct super_block *sb = sdp->sd_vfs; + int frozen = (sb->s_writers.frozen == SB_UNFROZEN) ? 0 : 1; - return snprintf(buf, PAGE_SIZE, "%u\n", count); + return snprintf(buf, PAGE_SIZE, "%u\n", frozen); } static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len) { - ssize_t ret = len; - int error = 0; + int error; int n = simple_strtol(buf, NULL, 0); if (!capable(CAP_SYS_ADMIN)) @@ -111,19 +107,21 @@ static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len) switch (n) { case 0: - gfs2_unfreeze_fs(sdp); + error = thaw_super(sdp->sd_vfs); break; case 1: - error = gfs2_freeze_fs(sdp); + error = freeze_super(sdp->sd_vfs); break; default: - ret = -EINVAL; + return -EINVAL; } - if (error) + if (error) { fs_warn(sdp, "freeze %d error %d", n, error); + return error; + } - return ret; + return len; } static ssize_t withdraw_show(struct gfs2_sbd *sdp, char *buf) -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 07/10] GFS2: Use ->writepages for ordered writes 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (5 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 06/10] GFS2: Clean up freeze code Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 08/10] GFS2: Split glock lru processing into two parts Steven Whitehouse ` (2 subsequent siblings) 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com Instead of using a list of buffers to write ahead of the journal flush, this now uses a list of inodes and calls ->writepages via filemap_fdatawrite() in order to achieve the same thing. For most use cases this results in a shorter ordered write list, as well as much larger i/os being issued. The ordered write list is sorted by inode number before writing in order to retain the disk block ordering between inodes as per the previous code. The previous ordered write code used to conflict in its assumptions about how to write out the disk blocks with mpage_writepages() so that with this updated version we can also use mpage_writepages() for GFS2's ordered write, writepages implementation. So we will also send larger i/os from writeback too. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 92340dd..24f414f 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -230,16 +230,14 @@ out_ignore: } /** - * gfs2_writeback_writepages - Write a bunch of dirty pages back to disk + * gfs2_writepages - Write a bunch of dirty pages back to disk * @mapping: The mapping to write * @wbc: Write-back control * - * For the data=writeback case we can already ignore buffer heads - * and write whole extents at once. This is a big reduction in the - * number of I/O requests we send and the bmap calls we make in this case. + * Used for both ordered and writeback modes. */ -static int gfs2_writeback_writepages(struct address_space *mapping, - struct writeback_control *wbc) +static int gfs2_writepages(struct address_space *mapping, + struct writeback_control *wbc) { return mpage_writepages(mapping, wbc, gfs2_get_block_noalloc); } @@ -1102,7 +1100,7 @@ cannot_release: static const struct address_space_operations gfs2_writeback_aops = { .writepage = gfs2_writeback_writepage, - .writepages = gfs2_writeback_writepages, + .writepages = gfs2_writepages, .readpage = gfs2_readpage, .readpages = gfs2_readpages, .write_begin = gfs2_write_begin, @@ -1118,6 +1116,7 @@ static const struct address_space_operations gfs2_writeback_aops = { static const struct address_space_operations gfs2_ordered_aops = { .writepage = gfs2_ordered_writepage, + .writepages = gfs2_writepages, .readpage = gfs2_readpage, .readpages = gfs2_readpages, .write_begin = gfs2_write_begin, diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 7a86275..d29d779 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -22,6 +22,7 @@ #include "meta_io.h" #include "quota.h" #include "rgrp.h" +#include "log.h" #include "super.h" #include "trans.h" #include "dir.h" @@ -1137,6 +1138,7 @@ static int trunc_end(struct gfs2_inode *ip) ip->i_height = 0; ip->i_goal = ip->i_no_addr; gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); + gfs2_ordered_del_inode(ip); } ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 19750bc..1533cf8 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -340,6 +340,7 @@ enum { GIF_QD_LOCKED = 1, GIF_ALLOC_FAILED = 2, GIF_SW_PAGED = 3, + GIF_ORDERED = 4, }; struct gfs2_inode { @@ -356,6 +357,7 @@ struct gfs2_inode { struct gfs2_rgrpd *i_rgd; u64 i_goal; /* goal block for allocations */ struct rw_semaphore i_rw_mutex; + struct list_head i_ordered; struct list_head i_trunc_list; __be64 *i_hash_cache; u32 i_entries; @@ -722,6 +724,7 @@ struct gfs2_sbd { struct list_head sd_log_le_revoke; struct list_head sd_log_le_databuf; struct list_head sd_log_le_ordered; + spinlock_t sd_ordered_lock; atomic_t sd_log_thresh1; atomic_t sd_log_thresh2; diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index f4beeb9..9a2ca8b 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -482,70 +482,66 @@ static void log_flush_wait(struct gfs2_sbd *sdp) } } -static int bd_cmp(void *priv, struct list_head *a, struct list_head *b) +static int ip_cmp(void *priv, struct list_head *a, struct list_head *b) { - struct gfs2_bufdata *bda, *bdb; + struct gfs2_inode *ipa, *ipb; - bda = list_entry(a, struct gfs2_bufdata, bd_list); - bdb = list_entry(b, struct gfs2_bufdata, bd_list); + ipa = list_entry(a, struct gfs2_inode, i_ordered); + ipb = list_entry(b, struct gfs2_inode, i_ordered); - if (bda->bd_bh->b_blocknr < bdb->bd_bh->b_blocknr) + if (ipa->i_no_addr < ipb->i_no_addr) return -1; - if (bda->bd_bh->b_blocknr > bdb->bd_bh->b_blocknr) + if (ipa->i_no_addr > ipb->i_no_addr) return 1; return 0; } static void gfs2_ordered_write(struct gfs2_sbd *sdp) { - struct gfs2_bufdata *bd; - struct buffer_head *bh; + struct gfs2_inode *ip; LIST_HEAD(written); - gfs2_log_lock(sdp); - list_sort(NULL, &sdp->sd_log_le_ordered, &bd_cmp); + spin_lock(&sdp->sd_ordered_lock); + list_sort(NULL, &sdp->sd_log_le_ordered, &ip_cmp); while (!list_empty(&sdp->sd_log_le_ordered)) { - bd = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_bufdata, bd_list); - list_move(&bd->bd_list, &written); - bh = bd->bd_bh; - if (!buffer_dirty(bh)) + ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); + list_move(&ip->i_ordered, &written); + if (ip->i_inode.i_mapping->nrpages == 0) continue; - get_bh(bh); - gfs2_log_unlock(sdp); - lock_buffer(bh); - if (buffer_mapped(bh) && test_clear_buffer_dirty(bh)) { - bh->b_end_io = end_buffer_write_sync; - submit_bh(WRITE_SYNC, bh); - } else { - unlock_buffer(bh); - brelse(bh); - } - gfs2_log_lock(sdp); + spin_unlock(&sdp->sd_ordered_lock); + filemap_fdatawrite(ip->i_inode.i_mapping); + spin_lock(&sdp->sd_ordered_lock); } list_splice(&written, &sdp->sd_log_le_ordered); - gfs2_log_unlock(sdp); + spin_unlock(&sdp->sd_ordered_lock); } static void gfs2_ordered_wait(struct gfs2_sbd *sdp) { - struct gfs2_bufdata *bd; - struct buffer_head *bh; + struct gfs2_inode *ip; - gfs2_log_lock(sdp); + spin_lock(&sdp->sd_ordered_lock); while (!list_empty(&sdp->sd_log_le_ordered)) { - bd = list_entry(sdp->sd_log_le_ordered.prev, struct gfs2_bufdata, bd_list); - bh = bd->bd_bh; - if (buffer_locked(bh)) { - get_bh(bh); - gfs2_log_unlock(sdp); - wait_on_buffer(bh); - brelse(bh); - gfs2_log_lock(sdp); + ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); + list_del(&ip->i_ordered); + WARN_ON(!test_and_clear_bit(GIF_ORDERED, &ip->i_flags)); + if (ip->i_inode.i_mapping->nrpages == 0) continue; - } - list_del_init(&bd->bd_list); + spin_unlock(&sdp->sd_ordered_lock); + filemap_fdatawait(ip->i_inode.i_mapping); + spin_lock(&sdp->sd_ordered_lock); } - gfs2_log_unlock(sdp); + spin_unlock(&sdp->sd_ordered_lock); +} + +void gfs2_ordered_del_inode(struct gfs2_inode *ip) +{ + struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); + + spin_lock(&sdp->sd_ordered_lock); + if (test_and_clear_bit(GIF_ORDERED, &ip->i_flags)) + list_del(&ip->i_ordered); + spin_unlock(&sdp->sd_ordered_lock); } /** diff --git a/fs/gfs2/log.h b/fs/gfs2/log.h index 3fd5215..3566f35 100644 --- a/fs/gfs2/log.h +++ b/fs/gfs2/log.h @@ -48,6 +48,18 @@ static inline void gfs2_log_pointers_init(struct gfs2_sbd *sdp, sdp->sd_log_head = sdp->sd_log_tail = value; } +static inline void gfs2_ordered_add_inode(struct gfs2_inode *ip) +{ + struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); + + if (!test_bit(GIF_ORDERED, &ip->i_flags)) { + spin_lock(&sdp->sd_ordered_lock); + if (!test_and_set_bit(GIF_ORDERED, &ip->i_flags)) + list_add(&ip->i_ordered, &sdp->sd_log_le_ordered); + spin_unlock(&sdp->sd_ordered_lock); + } +} +extern void gfs2_ordered_del_inode(struct gfs2_inode *ip); extern unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct, unsigned int ssize); diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 5f5aba5..e063f22 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -102,6 +102,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) INIT_LIST_HEAD(&sdp->sd_log_le_revoke); INIT_LIST_HEAD(&sdp->sd_log_le_databuf); INIT_LIST_HEAD(&sdp->sd_log_le_ordered); + spin_lock_init(&sdp->sd_ordered_lock); init_waitqueue_head(&sdp->sd_log_waitq); init_waitqueue_head(&sdp->sd_logd_waitq); diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index c075b62..a3b40ee 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1524,6 +1524,7 @@ out: /* Case 3 starts here */ truncate_inode_pages(&inode->i_data, 0); gfs2_rs_delete(ip); + gfs2_ordered_del_inode(ip); clear_inode(inode); gfs2_dir_hash_inval(ip); ip->i_gl->gl_object = NULL; diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 14dbf6d..88162fa 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -159,7 +159,9 @@ static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl, } /** - * databuf_lo_add - Add a databuf to the transaction. + * gfs2_trans_add_data - Add a databuf to the transaction. + * @gl: The inode glock associated with the buffer + * @bh: The buffer to add * * This is used in two distinct cases: * i) In ordered write mode @@ -174,33 +176,18 @@ static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl, * blocks, which isn't an enormous overhead but twice as much as * for normal metadata blocks. */ -static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) +void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) { struct gfs2_trans *tr = current->journal_info; - struct address_space *mapping = bd->bd_bh->b_page->mapping; + struct gfs2_sbd *sdp = gl->gl_sbd; + struct address_space *mapping = bh->b_page->mapping; struct gfs2_inode *ip = GFS2_I(mapping->host); + struct gfs2_bufdata *bd; - if (tr) - tr->tr_touched = 1; - if (!list_empty(&bd->bd_list)) + if (!gfs2_is_jdata(ip)) { + gfs2_ordered_add_inode(ip); return; - set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); - set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); - if (gfs2_is_jdata(ip)) { - gfs2_pin(sdp, bd->bd_bh); - tr->tr_num_databuf_new++; - sdp->sd_log_num_databuf++; - list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); - } else { - list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); } -} - -void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) -{ - - struct gfs2_sbd *sdp = gl->gl_sbd; - struct gfs2_bufdata *bd; lock_buffer(bh); gfs2_log_lock(sdp); @@ -214,7 +201,15 @@ void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) gfs2_log_lock(sdp); } gfs2_assert(sdp, bd->bd_gl == gl); - databuf_lo_add(sdp, bd); + tr->tr_touched = 1; + if (list_empty(&bd->bd_list)) { + set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); + set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); + gfs2_pin(sdp, bd->bd_bh); + tr->tr_num_databuf_new++; + sdp->sd_log_num_databuf++; + list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); + } gfs2_log_unlock(sdp); unlock_buffer(bh); } -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 08/10] GFS2: Split glock lru processing into two parts 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (6 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 07/10] GFS2: Use ->writepages for ordered writes Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 09/10] GFS2: Get a block reservation before resizing a file Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 10/10] GFS2: Reinstate withdraw ack system Steven Whitehouse 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com The intent here is to split the processing of the glock lru list into two parts, so that the selection of glocks and the disposal are separate functions. The plan is then, that further updates can then be made to these functions in the future to improve the selection of glocks and also the efficiency of glock disposal. The new feature which this patch brings is sorting the glocks to be disposed of into glock number (and thus also disk block number) order. Not all glocks will need i/o in order to dispose of them, but some will, and at least we'll generate mostly disk block order i/o now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 3ad8fd3..cf35155 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -30,6 +30,7 @@ #include <linux/rculist_bl.h> #include <linux/bit_spinlock.h> #include <linux/percpu.h> +#include <linux/list_sort.h> #include "gfs2.h" #include "incore.h" @@ -1376,50 +1377,93 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret) gfs2_glock_put(gl); } +static int glock_cmp(void *priv, struct list_head *a, struct list_head *b) +{ + struct gfs2_glock *gla, *glb; + + gla = list_entry(a, struct gfs2_glock, gl_lru); + glb = list_entry(b, struct gfs2_glock, gl_lru); + + if (gla->gl_name.ln_number > glb->gl_name.ln_number) + return 1; + if (gla->gl_name.ln_number < glb->gl_name.ln_number) + return -1; + + return 0; +} + +/** + * gfs2_dispose_glock_lru - Demote a list of glocks + * @list: The list to dispose of + * + * Disposing of glocks may involve disk accesses, so that here we sort + * the glocks by number (i.e. disk location of the inodes) so that if + * there are any such accesses, they'll be sent in order (mostly). + * + * Must be called under the lru_lock, but may drop and retake this + * lock. While the lru_lock is dropped, entries may vanish from the + * list, but no new entries will appear on the list (since it is + * private) + */ + +static void gfs2_dispose_glock_lru(struct list_head *list) +__releases(&lru_lock) +__acquires(&lru_lock) +{ + struct gfs2_glock *gl; + + list_sort(NULL, list, glock_cmp); + + while(!list_empty(list)) { + gl = list_entry(list->next, struct gfs2_glock, gl_lru); + list_del_init(&gl->gl_lru); + clear_bit(GLF_LRU, &gl->gl_flags); + gfs2_glock_hold(gl); + spin_unlock(&lru_lock); + spin_lock(&gl->gl_spin); + if (demote_ok(gl)) + handle_callback(gl, LM_ST_UNLOCKED, 0); + WARN_ON(!test_and_clear_bit(GLF_LOCK, &gl->gl_flags)); + smp_mb__after_clear_bit(); + if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) + gfs2_glock_put_nolock(gl); + spin_unlock(&gl->gl_spin); + spin_lock(&lru_lock); + } +} + /** * gfs2_scan_glock_lru - Scan the LRU looking for locks to demote * @nr: The number of entries to scan * + * This function selects the entries on the LRU which are able to + * be demoted, and then kicks off the process by calling + * gfs2_dispose_glock_lru() above. */ static void gfs2_scan_glock_lru(int nr) { struct gfs2_glock *gl; - int may_demote; - int nr_skipped = 0; LIST_HEAD(skipped); + LIST_HEAD(dispose); spin_lock(&lru_lock); while(nr && !list_empty(&lru_list)) { gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru); - list_del_init(&gl->gl_lru); - clear_bit(GLF_LRU, &gl->gl_flags); - atomic_dec(&lru_count); /* Test for being demotable */ if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) { - gfs2_glock_hold(gl); - spin_unlock(&lru_lock); - spin_lock(&gl->gl_spin); - may_demote = demote_ok(gl); - if (may_demote) { - handle_callback(gl, LM_ST_UNLOCKED, 0); - nr--; - } - clear_bit(GLF_LOCK, &gl->gl_flags); - smp_mb__after_clear_bit(); - if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) - gfs2_glock_put_nolock(gl); - spin_unlock(&gl->gl_spin); - spin_lock(&lru_lock); + list_move(&gl->gl_lru, &dispose); + atomic_dec(&lru_count); + nr--; continue; } - nr_skipped++; - list_add(&gl->gl_lru, &skipped); - set_bit(GLF_LRU, &gl->gl_flags); + + list_move(&gl->gl_lru, &skipped); } list_splice(&skipped, &lru_list); - atomic_add(nr_skipped, &lru_count); + if (!list_empty(&dispose)) + gfs2_dispose_glock_lru(&dispose); spin_unlock(&lru_lock); } -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 09/10] GFS2: Get a block reservation before resizing a file 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (7 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 08/10] GFS2: Split glock lru processing into two parts Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 10/10] GFS2: Reinstate withdraw ack system Steven Whitehouse 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com From: Bob Peterson <rpeterso@redhat.com> This patch allocates a block reservation structure before growing or shrinking a file. Without this structure, the grow or shink code can reference the bad pointer. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index d29d779..df686d1 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1288,6 +1288,10 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize) inode_dio_wait(inode); + ret = gfs2_rs_alloc(GFS2_I(inode)); + if (ret) + return ret; + oldsize = inode->i_size; if (newsize >= oldsize) return do_grow(inode, newsize); -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] [PATCH 10/10] GFS2: Reinstate withdraw ack system 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse ` (8 preceding siblings ...) 2013-02-19 10:07 ` [Cluster-devel] [PATCH 09/10] GFS2: Get a block reservation before resizing a file Steven Whitehouse @ 2013-02-19 10:07 ` Steven Whitehouse 9 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-02-19 10:07 UTC (permalink / raw) To: cluster-devel.redhat.com This patch reinstates the ack system which withdraw should be using. It appears to have been accidentally forgotten when the lock module was merged into GFS2, due to two different sysfs files having the same name. Reported-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 1533cf8..e2601ba 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -642,6 +642,7 @@ struct gfs2_sbd { wait_queue_head_t sd_glock_wait; atomic_t sd_glock_disposal; struct completion sd_locking_init; + struct completion sd_wdack; struct delayed_work sd_control_work; /* Inode Stuff */ diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index e063f22..1b612be 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -81,6 +81,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) init_waitqueue_head(&sdp->sd_glock_wait); atomic_set(&sdp->sd_glock_disposal, 0); init_completion(&sdp->sd_locking_init); + init_completion(&sdp->sd_wdack); spin_lock_init(&sdp->sd_statfs_spin); spin_lock_init(&sdp->sd_rindex_spin); diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 462e841..4fb9ad8 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -330,6 +330,28 @@ static ssize_t block_store(struct gfs2_sbd *sdp, const char *buf, size_t len) return ret; } +static ssize_t wdack_show(struct gfs2_sbd *sdp, char *buf) +{ + int val = completion_done(&sdp->sd_wdack) ? 1 : 0; + + return sprintf(buf, "%d\n", val); +} + +static ssize_t wdack_store(struct gfs2_sbd *sdp, const char *buf, size_t len) +{ + ssize_t ret = len; + int val; + + val = simple_strtol(buf, NULL, 0); + + if ((val == 1) && + !strcmp(sdp->sd_lockstruct.ls_ops->lm_proto_name, "lock_dlm")) + complete(&sdp->sd_wdack); + else + ret = -EINVAL; + return ret; +} + static ssize_t lkfirst_show(struct gfs2_sbd *sdp, char *buf) { struct lm_lockstruct *ls = &sdp->sd_lockstruct; @@ -461,7 +483,7 @@ static struct gfs2_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store) GDLM_ATTR(proto_name, 0444, proto_name_show, NULL); GDLM_ATTR(block, 0644, block_show, block_store); -GDLM_ATTR(withdraw, 0644, withdraw_show, withdraw_store); +GDLM_ATTR(withdraw, 0644, wdack_show, wdack_store); GDLM_ATTR(jid, 0644, jid_show, jid_store); GDLM_ATTR(first, 0644, lkfirst_show, lkfirst_store); GDLM_ATTR(first_done, 0444, first_done_show, NULL); diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index f00d7c5..6402fb6 100644 --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -54,6 +54,9 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...) kobject_uevent(&sdp->sd_kobj, KOBJ_OFFLINE); + if (!strcmp(sdp->sd_lockstruct.ls_ops->lm_proto_name, "lock_dlm")) + wait_for_completion(&sdp->sd_wdack); + if (lm->lm_unmount) { fs_err(sdp, "telling LM to unmount\n"); lm->lm_unmount(sdp); -- 1.7.4 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2014-12-08 12:38 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2014-12-08 12:38 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, In contrast to recent merge windows, there are a number of interesting features this time. There is a set of patches to improve performance in relation to block reservations. Some correctness fixes for fallocate, and an update to the freeze/thaw code which greatly simplyfies this code path. In addition there is a set of clean ups from Al Viro too, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2014-10-08 9:53 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2014-10-08 9:53 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Not a huge amount this time... just four patches. This time we have a couple of bug fixes, one relating to bad i_goal values which are now ignored (i_goal is basically a hint so it is safe to so this) and another relating to the saving of the dirent location during rename. There is one performance improvement, which is an optimisation in rgblk_free so that multiple block deallocations will now be more efficient, and one clean up patch to use _RET_IP_ rather than writing it out longhand, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2014-06-03 11:02 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2014-06-03 11:02 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, This must be about the smallest merge window patch set ever for GFS2. It is probably also the first one without a single patch from me. That is down to a combination of factors, and I have some things in the works that are not quite ready yet, that I hope to put in next time around. Returning to what is here this time... we have 3 patches which fix various warnings. Two are bug fixes (for quotas and also a rare recovery race condition). The final patch, from Ben Marzinski, is an important change in the freeze code which has been in progress for some time. This removes the need to take and drop the transaction lock for every single transaction, when the only time it was used, was at file system freeze time. Ben's patch integrates the freeze operation into the journal flush code as an alternative with lower overheads and also lands up resolving some difficult to fix races at the same time, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2014-04-01 9:15 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2014-04-01 9:15 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Here is the current content of the GFS2 -nmw tree for the current merge window. One of the main highlights this time, is not the patches themselves but instead the widening contributor base. It is good to see that interest is increasing in GFS2, and I'd like to thank all the contributors to this patch set. In addition to the usual set of bug fixes and clean ups, there are patches to improve inode creation performance when xattrs are required and some improvements to the transaction code which is intended to help improve scalability after further changes in due course. Journal extent mapping is also updated to make it more efficient and again, this is a foundation for future work in this area. The maximum number of ACLs has been increased to 300 (for a 4k block size) which means that even with a few additional xattrs from selinux, everything should fit within a single fs block. There is also a patch to bring GFS2's own copy of the writepages code up to the same level as the core VFS. Eventually we may be able to merge some of this code, since it is fairly similar. The other major change this time, is bringing consistency to the printing of messages via fs_<level>, pr_<level> macros. Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2014-01-20 12:23 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2014-01-20 12:23 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Here are the pending patches for the merge window which are currently in the GFS2 tree. The main topics this time are allocation, in the form of Bob's improvements when searching resource groups and several updates to quotas which should increase scalability. The quota changes follow on from those in the last merge window, and there will likely be further work to come in this area in due course. There are also a few patches which help to improve efficiency of adding entries into directories, and clean up some of that code. One on-disk change is included this time, which is to write some additional information which should be useful to fsck and also potentially for debugging. Other than that, its just a few small random bug fixes and clean ups, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2013-11-04 11:09 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-11-04 11:09 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, I'm just back from firstly Edinburgh, and secondly holiday, and the merge window is again upon us. I've added in the three pending patches which were under test while I was away and then that should be it for this time. The main feature of interest this time is quota updates. There are some clean ups and some patches to use the new generic lru list code. There is still plenty of scope for some further changes in due course - faster lookups of quota structures is very much on the todo list. Also, a start has been made towards the more tricky issue of using the generic lru code with glocks, but that will have to be completed in a subsequent merge window. The other, more minor feature, is that there have been a number of performance patches which relate to block allocation. In particular they will improve performance when the disk is nearly full, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2 Pre-pull patch posting (merge window) @ 2013-09-05 9:02 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-09-05 9:02 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, This is the smallest merge window patch set for GFS2 for quite some time. Only one of the patches (moving gfs2_sync_meta) is a non-bug fix patch, although the merge ordered and writeback writepage patch is also a nice clean up. A couple of the patches are quite recently added, due to my only having recently returned from holiday, so I'll give them a couple of extra days in -next before sending the pull request. Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2013-07-01 9:33 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-07-01 9:33 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, There are a few bug fixes for various, mostly very minor corner cases, plus some interesting new features. The new features include atomic_open whose main benefit will be the reduction in locking overhead in case of combined lookup/create and open operations, sorting the log buffer lists by block number to improve the efficiency of AIL writeback, and agressively issuing revokes in gfs2_log_flush to reduce overhead when dropping glocks, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2013-04-26 9:18 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2013-04-26 9:18 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Since the merge window is coming up soon, I'm posting the content of the GFS2 -nmw tree as usual. There is not a whole lot of change this time - there are some further changes which are in the works, but those will be held over until next time. Here there are some clean ups to inode creation, the addition of an origin (local or remote) indicator to glock demote requests, removal of one of the remaining GFP_NOFAIL allocations during log flushes, one minor clean up, and a one liner bug fix, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-11-30 9:52 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-11-30 9:52 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, So yes, this is a bit early, but the tree seems to have settled down now, and I'd like to hold off any further feature patches until the subsequent merge window at this stage. The main feature this time is the new Orlov allocator and the patches leading up to it which allow us to allocate new inodes from their own allocation context, rather than borrowing that of their parent directory. It is this change which then allows us to choose a different location for subdirectories when required. This works exactly as per the ext3 implementation from the users point of view. In addition to that, we've got a speed up in gfs2_rbm_from_block() from Bob Peterson, three locking related improvements from Dave Teigland plus a selection of smaller bug fixes and clean ups. Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-09-26 8:25 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-09-26 8:25 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, We've collected up a goodly number of patches in the -nmw tree now and we can hold off any further changes until the following merge window, so here is the current tree content. The major feature this time is the "rbm" conversion in the resource group code. The new struct gfs2_rbm specifies the location of an allocatable block in (resource group, bitmap, offset) form. There are a number of added helper functions, and later patches then rewrite some of the resource group code in terms of this new structure. Not only does this give us a nice code clean up, but it also removes some of the previous restructions where extents could not cross bitmap boundaries, for example. In addition to that, there are a few bug fixes and clean ups, but the rbm work is by far the majority of this patch set in terms of number of changed lines. Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-07-23 8:00 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-07-23 8:00 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, As usual, here is the content of the GFS2 tree prior to sending a merge request. Not a huge number of patches this time, but some interesting features nonetheless. A number of the earlier patches are aimed at cleaning up the resource group code for the later patch which implements block reservations. In addition to that, there are a few patches aimed at improving the time taken to dump (the potentially rather large) glock debugfs file. Beyond that there are a couple of bug fixes and thats about it this time, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-05-17 12:23 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-05-17 12:23 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Since the merge window appears to be fast approaching, here are the current GFS2 patches. This time there are two main themes, one is updates to the log code, mostly on the writing side. The other is preparation for some block reservation work which will probably land in the subsequent merge window. There is of course the usual collection of cleanup and bug fixes as well. See the individual patches for the detailed descriptions, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-03-19 10:25 Steven Whitehouse [not found] ` <4F674696.7030602@xenotime.net> 0 siblings, 1 reply; 39+ messages in thread From: Steven Whitehouse @ 2012-03-19 10:25 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Not a huge number of patches this time. Some notable new features though: - Glock stats gathering (v. useful for performance analysis) - FITRIM ioctl support - Sorting the ordered write list (big performance increase when the workload doesn't result in the write requests being nicely ordered to start with) Plus a few clean ups, and bug fixes in addition, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <4F674696.7030602@xenotime.net>]
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F674696.7030602@xenotime.net> @ 2012-03-19 14:59 ` Steven Whitehouse [not found] ` <4F674E4F.5080904@xenotime.net> 0 siblings, 1 reply; 39+ messages in thread From: Steven Whitehouse @ 2012-03-19 14:59 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Mon, 2012-03-19 at 07:45 -0700, Randy Dunlap wrote: > On 03/19/2012 03:25 AM, Steven Whitehouse wrote: > > > Hi, > > > > Not a huge number of patches this time. Some notable new features > > though: > > - Glock stats gathering (v. useful for performance analysis) > > - FITRIM ioctl support > > - Sorting the ordered write list (big performance increase when the workload > > doesn't result in the write requests being nicely ordered to start with) > > > > Plus a few clean ups, and bug fixes in addition, > > > > Hi, > > I reported a build error in linux-next 20120313, but it appears > that mainline also needs the fix (when it's ready) since mainline > gfs2 Kconfig selects DLM_SCTP, which does not exist. > > https://lkml.org/lkml/2012/3/13/456 > Does the following fix the problem? If so then I'll roll that into the tree before it gets pushed, Steve. diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig index c465ae0..f4e1c60 100644 --- a/fs/gfs2/Kconfig +++ b/fs/gfs2/Kconfig @@ -4,7 +4,7 @@ config GFS2_FS select DLM if GFS2_FS_LOCKING_DLM select CONFIGFS_FS if GFS2_FS_LOCKING_DLM select SYSFS if GFS2_FS_LOCKING_DLM - select IP_SCTP if DLM_SCTP + select IP_SCTP if GFS2_FS_LOCKING_DLM select FS_POSIX_ACL select CRC32 select QUOTACTL ^ permalink raw reply related [flat|nested] 39+ messages in thread
[parent not found: <4F674E4F.5080904@xenotime.net>]
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F674E4F.5080904@xenotime.net> @ 2012-03-19 15:34 ` Steven Whitehouse 2012-03-23 19:41 ` David Teigland 2012-03-20 9:47 ` Steven Whitehouse 1 sibling, 1 reply; 39+ messages in thread From: Steven Whitehouse @ 2012-03-19 15:34 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Mon, 2012-03-19 at 08:18 -0700, Randy Dunlap wrote: > On 03/19/2012 07:59 AM, Steven Whitehouse wrote: > > > Hi, > > > > On Mon, 2012-03-19 at 07:45 -0700, Randy Dunlap wrote: > >> On 03/19/2012 03:25 AM, Steven Whitehouse wrote: > >> > >>> Hi, > >>> > >>> Not a huge number of patches this time. Some notable new features > >>> though: > >>> - Glock stats gathering (v. useful for performance analysis) > >>> - FITRIM ioctl support > >>> - Sorting the ordered write list (big performance increase when the workload > >>> doesn't result in the write requests being nicely ordered to start with) > >>> > >>> Plus a few clean ups, and bug fixes in addition, > >> > >> > >> > >> Hi, > >> > >> I reported a build error in linux-next 20120313, but it appears > >> that mainline also needs the fix (when it's ready) since mainline > >> gfs2 Kconfig selects DLM_SCTP, which does not exist. > >> > >> https://lkml.org/lkml/2012/3/13/456 > >> > > > > Does the following fix the problem? If so then I'll roll that into the > > tree before it gets pushed, > > > > No, that's not sufficient: > > warning: (GFS2_FS) selects DLM which has unmet direct dependencies (EXPERIMENTAL && INET && SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n)) > warning: (DLM && GFS2_FS) selects IP_SCTP which has unmet direct dependencies (NET && INET && EXPERIMENTAL && (IPV6 || IPV6=n)) > > and > > ERROR: "crc32c" [net/sctp/sctp.ko] undefined! > > Hmm, ok. I'll look at this again. I'm not sure why DLM is still calling itself EXPERIMENTAL since thats long since not been the case, maybe SCTP still is, but I don't think GFS2 should be selecting EXPERIMENTAL directly, anyway. It is rather easy to tie ones' self in knots with this config language.... since GFS2_FS_LOCKING_DLM depends on NET && INET && (IPV6 || IPV6=n) && HOTPLUG then all those other deps must presumably be set anyway, so I don't understand quite why DLM doesn't have those available to it. I'll dig around a bit and see if I can figure out whats going on here, Steve. > > > > > > diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig > > index c465ae0..f4e1c60 100644 > > --- a/fs/gfs2/Kconfig > > +++ b/fs/gfs2/Kconfig > > @@ -4,7 +4,7 @@ config GFS2_FS > > select DLM if GFS2_FS_LOCKING_DLM > > select CONFIGFS_FS if GFS2_FS_LOCKING_DLM > > select SYSFS if GFS2_FS_LOCKING_DLM > > - select IP_SCTP if DLM_SCTP > > + select IP_SCTP if GFS2_FS_LOCKING_DLM > > select FS_POSIX_ACL > > select CRC32 > > select QUOTACTL > > > > > > > ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) 2012-03-19 15:34 ` Steven Whitehouse @ 2012-03-23 19:41 ` David Teigland 2012-03-23 19:46 ` David Miller [not found] ` <4F6CD7AD.9030306@xenotime.net> 0 siblings, 2 replies; 39+ messages in thread From: David Teigland @ 2012-03-23 19:41 UTC (permalink / raw) To: cluster-devel.redhat.com > on i386: > > ERROR: "sctp_do_peeloff" [fs/dlm/dlm.ko] undefined! > > > GFS2_FS selects DLM (if GFS2_FS_LOCKING_DLM, which is enabled). > GFS2_FS selects IP_SCTP if DLM_SCTP, which is not enabled and not > used anywhere else in the kernel tree AFAICT. > DLM just always selects IP_SCTP. Here's what we have now: config GFS2_FS tristate "GFS2 file system support" depends on (64BIT || LBDAF) select DLM if GFS2_FS_LOCKING_DLM select CONFIGFS_FS if GFS2_FS_LOCKING_DLM select SYSFS if GFS2_FS_LOCKING_DLM select IP_SCTP if DLM_SCTP select FS_POSIX_ACL select CRC32 select QUOTACTL menuconfig DLM tristate "Distributed Lock Manager (DLM)" depends on EXPERIMENTAL && INET depends on SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n) select IP_SCTP Why does gfs2 Kconfig bother with SCTP at all? It seems that line should just be removed. I'll also remove EXPERIMENTAL. I don't understand the vagaries of Kconfig, so a dumb question, how could sctp_do_peeloff possibly be undefined if we're selecting SCTP. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) 2012-03-23 19:41 ` David Teigland @ 2012-03-23 19:46 ` David Miller [not found] ` <4F6CD7AD.9030306@xenotime.net> 1 sibling, 0 replies; 39+ messages in thread From: David Miller @ 2012-03-23 19:46 UTC (permalink / raw) To: cluster-devel.redhat.com From: David Teigland <teigland@redhat.com> Date: Fri, 23 Mar 2012 15:41:52 -0400 > Why does gfs2 Kconfig bother with SCTP at all? It seems that line should > just be removed. I'll also remove EXPERIMENTAL. I don't understand the > vagaries of Kconfig, so a dumb question, how could sctp_do_peeloff > possibly be undefined if we're selecting SCTP. GFS2=y SCTP=m ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <4F6CD7AD.9030306@xenotime.net>]
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F6CD7AD.9030306@xenotime.net> @ 2012-03-23 20:09 ` Steven Whitehouse 2012-03-23 20:18 ` David Teigland 1 sibling, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-03-23 20:09 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Fri, 2012-03-23 at 13:06 -0700, Randy Dunlap wrote: > On 03/23/2012 12:41 PM, David Teigland wrote: > > > > >> on i386: > >> > >> ERROR: "sctp_do_peeloff" [fs/dlm/dlm.ko] undefined! > >> > >> > >> GFS2_FS selects DLM (if GFS2_FS_LOCKING_DLM, which is enabled). > >> GFS2_FS selects IP_SCTP if DLM_SCTP, which is not enabled and not > >> used anywhere else in the kernel tree AFAICT. > >> DLM just always selects IP_SCTP. > > > > Here's what we have now: > > > > config GFS2_FS > > tristate "GFS2 file system support" > > depends on (64BIT || LBDAF) > > select DLM if GFS2_FS_LOCKING_DLM > > select CONFIGFS_FS if GFS2_FS_LOCKING_DLM > > select SYSFS if GFS2_FS_LOCKING_DLM > > select IP_SCTP if DLM_SCTP > > select FS_POSIX_ACL > > select CRC32 > > select QUOTACTL > > > > menuconfig DLM > > tristate "Distributed Lock Manager (DLM)" > > depends on EXPERIMENTAL && INET > > depends on SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n) > > select IP_SCTP > > > > Why does gfs2 Kconfig bother with SCTP at all? It seems that line should > > just be removed. I'll also remove EXPERIMENTAL. I don't understand the > > vagaries of Kconfig, so a dumb question, how could sctp_do_peeloff > > possibly be undefined if we're selecting SCTP. > > What is selecting SCTP? DLM? so GFS2 selects DLM, but selects > don't follow dependency chains. Also, the "select IP_SCTP if DLM_SCTP" > in GFS2 is meaningless since there is no DLM_SCTP. > > I just verified that the (posted) failing config still fails with > today's linux-next. > The DLM_SCTP is historical. There used to be such a thing, but that config option went away, and there is now run time selection of the DLM transport. So that the GFS2 Kconfig should have been updated, however that appears not to be enough on its own to resolve the issue, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F6CD7AD.9030306@xenotime.net> 2012-03-23 20:09 ` Steven Whitehouse @ 2012-03-23 20:18 ` David Teigland [not found] ` <20120323220618.GA30906@d2.synalogic.ca> 1 sibling, 1 reply; 39+ messages in thread From: David Teigland @ 2012-03-23 20:18 UTC (permalink / raw) To: cluster-devel.redhat.com On Fri, Mar 23, 2012 at 01:06:05PM -0700, Randy Dunlap wrote: > >> GFS2_FS selects DLM (if GFS2_FS_LOCKING_DLM, which is enabled). > >> GFS2_FS selects IP_SCTP if DLM_SCTP, which is not enabled and not > >> used anywhere else in the kernel tree AFAICT. > >> DLM just always selects IP_SCTP. > > > > Here's what we have now: > > > > config GFS2_FS > > tristate "GFS2 file system support" > > depends on (64BIT || LBDAF) > > select DLM if GFS2_FS_LOCKING_DLM > > select CONFIGFS_FS if GFS2_FS_LOCKING_DLM > > select SYSFS if GFS2_FS_LOCKING_DLM > > select IP_SCTP if DLM_SCTP > > select FS_POSIX_ACL > > select CRC32 > > select QUOTACTL > > > > menuconfig DLM > > tristate "Distributed Lock Manager (DLM)" > > depends on EXPERIMENTAL && INET > > depends on SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n) > > select IP_SCTP > > > > Why does gfs2 Kconfig bother with SCTP at all? It seems that line should > > just be removed. I'll also remove EXPERIMENTAL. I don't understand the > > vagaries of Kconfig, so a dumb question, how could sctp_do_peeloff > > possibly be undefined if we're selecting SCTP. > > What is selecting SCTP? DLM? so GFS2 selects DLM, but selects > don't follow dependency chains. Also, the "select IP_SCTP if DLM_SCTP" > in GFS2 is meaningless since there is no DLM_SCTP. https://lkml.org/lkml/2012/3/8/222 seems to have caused this by adding the new dependency on the sctp module without any Kconfig changes. Should that patch have added depends IP_SCTP to the dlm and gfs2? ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <20120323220618.GA30906@d2.synalogic.ca>]
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <20120323220618.GA30906@d2.synalogic.ca> @ 2012-03-26 10:44 ` Steven Whitehouse [not found] ` <4F79C733.60604@xenotime.net> 0 siblings, 1 reply; 39+ messages in thread From: Steven Whitehouse @ 2012-03-26 10:44 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Fri, 2012-03-23 at 18:06 -0400, Benjamin Poirier wrote: [snip] > > Instead of trying to select everything in GFS2, how about doing it this way? > > [PATCH] gfs2: use depends instead of select in kconfig > > Avoids having to duplicate the dependencies of what is 'select'ed (and on > down...) > > Those dependencies are currently incomplete, leading to broken builds with > GFS2_FS_LOCKING_DLM=y and IP_SCTP=n. > > Signed-off-by: Benjamin Poirier <bpoirier@suse.de> > --- > fs/gfs2/Kconfig | 7 ++----- > 1 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig > index c465ae0..eb08c9e 100644 > --- a/fs/gfs2/Kconfig > +++ b/fs/gfs2/Kconfig > @@ -1,10 +1,6 @@ > config GFS2_FS > tristate "GFS2 file system support" > depends on (64BIT || LBDAF) > - select DLM if GFS2_FS_LOCKING_DLM > - select CONFIGFS_FS if GFS2_FS_LOCKING_DLM > - select SYSFS if GFS2_FS_LOCKING_DLM > - select IP_SCTP if DLM_SCTP > select FS_POSIX_ACL > select CRC32 > select QUOTACTL > @@ -29,7 +25,8 @@ config GFS2_FS > > config GFS2_FS_LOCKING_DLM > bool "GFS2 DLM locking" > - depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && HOTPLUG > + depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ > + HOTPLUG && DLM && CONFIGFS_FS && SYSFS > help > Multiple node locking module for GFS2 > That looks ok to me. I've put it in the GFS2 -fixes tree, and if everybody is happy with that I'll send a pull request shortly, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <4F79C733.60604@xenotime.net>]
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F79C733.60604@xenotime.net> @ 2012-04-02 15:47 ` Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-04-02 15:47 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Mon, 2012-04-02 at 08:35 -0700, Randy Dunlap wrote: > On 03/26/2012 03:44 AM, Steven Whitehouse wrote: > > > Hi, > > > > On Fri, 2012-03-23 at 18:06 -0400, Benjamin Poirier wrote: > > [snip] > >> > >> Instead of trying to select everything in GFS2, how about doing it this way? > >> > >> [PATCH] gfs2: use depends instead of select in kconfig > >> > >> Avoids having to duplicate the dependencies of what is 'select'ed (and on > >> down...) > >> > >> Those dependencies are currently incomplete, leading to broken builds with > >> GFS2_FS_LOCKING_DLM=y and IP_SCTP=n. > >> > >> Signed-off-by: Benjamin Poirier <bpoirier@suse.de> > >> --- > >> fs/gfs2/Kconfig | 7 ++----- > >> 1 files changed, 2 insertions(+), 5 deletions(-) > >> > >> diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig > >> index c465ae0..eb08c9e 100644 > >> --- a/fs/gfs2/Kconfig > >> +++ b/fs/gfs2/Kconfig > >> @@ -1,10 +1,6 @@ > >> config GFS2_FS > >> tristate "GFS2 file system support" > >> depends on (64BIT || LBDAF) > >> - select DLM if GFS2_FS_LOCKING_DLM > >> - select CONFIGFS_FS if GFS2_FS_LOCKING_DLM > >> - select SYSFS if GFS2_FS_LOCKING_DLM > >> - select IP_SCTP if DLM_SCTP > >> select FS_POSIX_ACL > >> select CRC32 > >> select QUOTACTL > >> @@ -29,7 +25,8 @@ config GFS2_FS > >> > >> config GFS2_FS_LOCKING_DLM > >> bool "GFS2 DLM locking" > >> - depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && HOTPLUG > >> + depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ > >> + HOTPLUG && DLM && CONFIGFS_FS && SYSFS > >> help > >> Multiple node locking module for GFS2 > >> > > > > That looks ok to me. I've put it in the GFS2 -fixes tree, and if > > everybody is happy with that I'll send a pull request shortly, > > > Can we get Benjamin's patch merged, please? > linux-next is still having build errors without it. > It is in the GFS2 -nmw tree now, so it will be in linux-next shortly. I'll merge up the -fixes tree shortly, but I'm expecting one more patch for that very shortly, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) [not found] ` <4F674E4F.5080904@xenotime.net> 2012-03-19 15:34 ` Steven Whitehouse @ 2012-03-20 9:47 ` Steven Whitehouse 1 sibling, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-03-20 9:47 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, On Mon, 2012-03-19 at 08:18 -0700, Randy Dunlap wrote: > On 03/19/2012 07:59 AM, Steven Whitehouse wrote: > > > Hi, > > > > On Mon, 2012-03-19 at 07:45 -0700, Randy Dunlap wrote: > >> On 03/19/2012 03:25 AM, Steven Whitehouse wrote: > >> > >>> Hi, > >>> > >>> Not a huge number of patches this time. Some notable new features > >>> though: > >>> - Glock stats gathering (v. useful for performance analysis) > >>> - FITRIM ioctl support > >>> - Sorting the ordered write list (big performance increase when the workload > >>> doesn't result in the write requests being nicely ordered to start with) > >>> > >>> Plus a few clean ups, and bug fixes in addition, > >> > >> > >> > >> Hi, > >> > >> I reported a build error in linux-next 20120313, but it appears > >> that mainline also needs the fix (when it's ready) since mainline > >> gfs2 Kconfig selects DLM_SCTP, which does not exist. > >> > >> https://lkml.org/lkml/2012/3/13/456 > >> > > > > Does the following fix the problem? If so then I'll roll that into the > > tree before it gets pushed, > > > > No, that's not sufficient: > > warning: (GFS2_FS) selects DLM which has unmet direct dependencies (EXPERIMENTAL && INET && SYSFS && CONFIGFS_FS && (IPV6 || IPV6=n)) > warning: (DLM && GFS2_FS) selects IP_SCTP which has unmet direct dependencies (NET && INET && EXPERIMENTAL && (IPV6 || IPV6=n)) > > and > > ERROR: "crc32c" [net/sctp/sctp.ko] undefined! > > Since the pending patch set doesn't affect the Kconfig at all, I don't think that this issue needs to hold up merging the GFS2 tree. We'll follow up with a fix for this later on, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2012-01-05 11:51 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2012-01-05 11:51 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, The main feature this time is clean up around the allocation and resource group code. Otherwise the remainder is mostly small bug fixes. I've held back the glock stats patch and that will probably be ready for the following merge window with a bit of luck, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2011-10-24 12:48 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2011-10-24 12:48 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Since the merge window is upon us, here is the current content of the GFS2 git tree. A few things will be help back to the following merge window in order to ensure a greater test time, but those currently in the tree are ready for the current window. Recently I've reconstituted the GFS2 git tree, so it can be pulled (via http) from: http://sucs.org/~rohan/git/gfs2-3.0-nmw and viewed via gitweb at: http://sucs.org/gitweb/ This is thanks to the Swansea University Computer Society for providing a temporary (or possibly permanent) home for the GFS2 git trees. Please treat their server kindly as this will only continue while it doesn't generate too much traffic. I figure that there will not be too many people pulling the GFS2 tree at once, but we'll see. Some highlights of the current patch set: o Reduction in code of approx 400 lines o Big clean up (and speed up) in the resource group code - This is a nice base to build some forthcoming improvements on - It should improve performance with multi-threaded workloads o Some left-over fsync/writeback changes o Improvements to readahead when deallocating large directories Any questions/concerns then please let me know as usual, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2011-07-22 9:16 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2011-07-22 9:16 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Not a lot new this time... the addition of a cache for the directory hash table improve directory read/lookup speed, automatic adjustment of the glock hold time improves performance for some contention corner cases. S_NOSEC support is another performance related change, plus a nice clean up from Eric Sandeen, Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2011-05-19 8:46 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2011-05-19 8:46 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, This time, most of the GFS2 patches are code clean up, although there are a few bug fixes (fallocate/ail writeback/end of life inodes/nlink) and some new features (new tracepoint & tracing flags, using the UUID field in the generic superblock). The changes can be broadly divided into three sets: 1. Bob's directory code clean up 2. My fsync/ail writeback fixes & clean up 3. inode.c/ops_inode.c clean up Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
* [Cluster-devel] GFS2: Pre-pull patch posting (merge window) @ 2011-03-15 9:11 Steven Whitehouse 0 siblings, 0 replies; 39+ messages in thread From: Steven Whitehouse @ 2011-03-15 9:11 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, The most interesting "feature" in this patch set is the RCU glock patch which has been a long time coming, but is finally here. That patch contains most of the changes this time. The other patches ins this set are mostly smaller bug fixes and performance improvements. Steve. ^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2014-12-08 12:38 UTC | newest] Thread overview: 39+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-02-19 10:07 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 01/10] GFS2: Separate LRU scanning from shrinker Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 02/10] GFS2: Merge revoke adding functions Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 03/10] GFS2: Split gfs2_trans_add_bh() into two Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 04/10] GFS2: Copy gfs2_trans_add_bh into new data/meta functions Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 05/10] GFS2: Merge gfs2_attach_bufdata() into trans.c Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 06/10] GFS2: Clean up freeze code Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 07/10] GFS2: Use ->writepages for ordered writes Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 08/10] GFS2: Split glock lru processing into two parts Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 09/10] GFS2: Get a block reservation before resizing a file Steven Whitehouse 2013-02-19 10:07 ` [Cluster-devel] [PATCH 10/10] GFS2: Reinstate withdraw ack system Steven Whitehouse -- strict thread matches above, loose matches on Subject: below -- 2014-12-08 12:38 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse 2014-10-08 9:53 Steven Whitehouse 2014-06-03 11:02 Steven Whitehouse 2014-04-01 9:15 Steven Whitehouse 2014-01-20 12:23 Steven Whitehouse 2013-11-04 11:09 Steven Whitehouse 2013-09-05 9:02 [Cluster-devel] GFS2 " Steven Whitehouse 2013-07-01 9:33 [Cluster-devel] GFS2: " Steven Whitehouse 2013-04-26 9:18 Steven Whitehouse 2012-11-30 9:52 Steven Whitehouse 2012-09-26 8:25 Steven Whitehouse 2012-07-23 8:00 Steven Whitehouse 2012-05-17 12:23 Steven Whitehouse 2012-03-19 10:25 Steven Whitehouse [not found] ` <4F674696.7030602@xenotime.net> 2012-03-19 14:59 ` Steven Whitehouse [not found] ` <4F674E4F.5080904@xenotime.net> 2012-03-19 15:34 ` Steven Whitehouse 2012-03-23 19:41 ` David Teigland 2012-03-23 19:46 ` David Miller [not found] ` <4F6CD7AD.9030306@xenotime.net> 2012-03-23 20:09 ` Steven Whitehouse 2012-03-23 20:18 ` David Teigland [not found] ` <20120323220618.GA30906@d2.synalogic.ca> 2012-03-26 10:44 ` Steven Whitehouse [not found] ` <4F79C733.60604@xenotime.net> 2012-04-02 15:47 ` Steven Whitehouse 2012-03-20 9:47 ` Steven Whitehouse 2012-01-05 11:51 Steven Whitehouse 2011-10-24 12:48 Steven Whitehouse 2011-07-22 9:16 Steven Whitehouse 2011-05-19 8:46 Steven Whitehouse 2011-03-15 9:11 Steven Whitehouse
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).