Skip to contentSkip to conversation

fsck.gfs2: Issue read-ahead for dinodes in each bitmap

PATCH New Bob Peterson 2 participants 2 messages Jul 10, 2014 – Jul 11, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 fsck.gfs2: Issue read-ahead for dinodes in each bitmap

Hi,

This patch speeds up fsck.gfs2 by issuing read-ahead for each of the dinodes found in each of the bitmaps, prior to processing the bitmap.

Regards,

Bob Peterson
Red Hat File Systems

---
 gfs2/fsck/pass1.c | 4 ++++
 1 file changed, 4 insertions(+)
gfs2/fsck/pass1.c +4 -0
index fec2f64..90ca357 100644
@@ -1442,6 +1442,10 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
 	struct gfs2_inode *ip;
 	uint8_t q;
 
+	/* Issue read-ahead for all dinodes in this bitmap */
+	for (i = 0; i < n; i++)
+		posix_fadvise(sdp->device_fd, ibuf[i] * sdp->bsize, sdp->bsize,
+			      POSIX_FADV_WILLNEED);
 	for (i = 0; i < n; i++) {
 		int is_inode;
 		uint32_t check_magic;
#2 lore raw

PATCH 1/1 fsck.gfs2: Issue read-ahead for dinodes in each bitmap

Hi,

Quoted 4 lines · Bob Peterson

Hi,

This patch speeds up fsck.gfs2 by issuing read-ahead for each of the dinodes found in each of the bitmaps, prior to processing the bitmap.

Looks good to me,

Steve.

Quoted 26 lines

Regards,

Bob Peterson
Red Hat File Systems

---
  gfs2/fsck/pass1.c | 4 ++++
  1 file changed, 4 insertions(+)
gfs2/fsck/pass1.c +4 -0
index fec2f64..90ca357 100644
@@ -1442,6 +1442,10 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
  	struct gfs2_inode *ip;
  	uint8_t q;
 
+	/* Issue read-ahead for all dinodes in this bitmap */
+	for (i = 0; i < n; i++)
+		posix_fadvise(sdp->device_fd, ibuf[i] * sdp->bsize, sdp->bsize,
+			      POSIX_FADV_WILLNEED);
  	for (i = 0; i < n; i++) {
  		int is_inode;
  		uint32_t check_magic;