All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] block: add BH_Meta flag
@ 2012-05-11 15:02 Saugata Das
  2012-05-11 15:02 ` [PATCH 2/2] ext4: annotate all meta data requests Saugata Das
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Saugata Das @ 2012-05-11 15:02 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel
  Cc: tytso, adilger, hch, arnd.bergmann, venkat, Saugata Das

From: Saugata Das <saugata.das@linaro.org>

Today, storage devices like eMMC has special features like data tagging
(introduced in MMC-4.5 version) in order to improve performance of some
specific writes. On MMC stack, data tagging is used for all writes which
has REQ_META flag set. This patch adds the capability to add REQ_META flag
during meta data write.

Signed-off-by: Saugata Das <saugata.das@linaro.org>
---
 fs/buffer.c                 |   10 ++++++++--
 include/linux/buffer_head.h |    2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 36d6665..688b38b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
 	do {
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
-			submit_bh(write_op, bh);
+			if (buffer_meta(bh))
+				submit_bh(write_op | REQ_META, bh);
+			else
+				submit_bh(write_op, bh);
 			nr_underway++;
 		}
 		bh = next;
@@ -1739,7 +1742,10 @@ recover:
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
 			clear_buffer_dirty(bh);
-			submit_bh(write_op, bh);
+			if (buffer_meta(bh))
+				submit_bh(write_op | REQ_META, bh);
+			else
+				submit_bh(write_op, bh);
 			nr_underway++;
 		}
 		bh = next;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index ef26043..0776564 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -34,6 +34,7 @@ enum bh_state_bits {
 	BH_Write_EIO,	/* I/O error on write */
 	BH_Unwritten,	/* Buffer is allocated on disk but not written */
 	BH_Quiet,	/* Buffer Error Prinks to be quiet */
+	BH_Meta,	/* Is meta */
 
 	BH_PrivateStart,/* not a state bit, but the first bit available
 			 * for private allocation by other entities
@@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
 BUFFER_FNS(Boundary, boundary)
 BUFFER_FNS(Write_EIO, write_io_error)
 BUFFER_FNS(Unwritten, unwritten)
+BUFFER_FNS(Meta, meta)
 
 #define bh_offset(bh)		((unsigned long)(bh)->b_data & ~PAGE_MASK)
 #define touch_buffer(bh)	mark_page_accessed(bh->b_page)
-- 
1.7.4.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ext4: annotate all meta data requests
  2012-05-11 15:02 [PATCH 1/2] block: add BH_Meta flag Saugata Das
@ 2012-05-11 15:02 ` Saugata Das
  2012-05-14  1:42 ` [PATCH 1/2] block: add BH_Meta flag Namhyung Kim
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Saugata Das @ 2012-05-11 15:02 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel
  Cc: tytso, adilger, hch, arnd.bergmann, venkat, Saugata Das

From: Saugata Das <saugata.das@linaro.org>

Today, storage devices like eMMC has special features like data tagging
(introduced in MMC-4.5 version) in order to improve performance of some
specific writes. On MMC stack, data tagging is used for all writes which has
REQ_META flag set. On EXT4, however, currently REQ_META is set only for read.
This patch adds the capability mark a meta-data buffer with set_buffer_meta
during meta data write. During submit_bh, this information is used to set
REQ_META flag.

Signed-off-by: Saugata Das <saugata.das@linaro.org>
---
 fs/ext4/ext4_jbd2.c |    4 ++++
 fs/ext4/inode.c     |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index aca1790..097c062 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -107,6 +107,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
 {
 	int err = 0;
 
+	set_buffer_meta(bh);
+
 	if (ext4_handle_valid(handle)) {
 		err = jbd2_journal_dirty_metadata(handle, bh);
 		if (err) {
@@ -143,6 +145,8 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line,
 	struct buffer_head *bh = EXT4_SB(sb)->s_sbh;
 	int err = 0;
 
+	set_buffer_meta(bh);
+
 	if (ext4_handle_valid(handle)) {
 		err = jbd2_journal_dirty_metadata(handle, bh);
 		if (err)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c77b0bd..754fe77 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4035,8 +4035,10 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc)
 		err = __ext4_get_inode_loc(inode, &iloc, 0);
 		if (err)
 			return err;
-		if (wbc->sync_mode == WB_SYNC_ALL)
+		if (wbc->sync_mode == WB_SYNC_ALL) {
+			set_buffer_meta(iloc.bh);
 			sync_dirty_buffer(iloc.bh);
+		}
 		if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) {
 			EXT4_ERROR_INODE_BLOCK(inode, iloc.bh->b_blocknr,
 					 "IO error syncing inode");
-- 
1.7.4.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] block: add BH_Meta flag
  2012-05-11 15:02 [PATCH 1/2] block: add BH_Meta flag Saugata Das
  2012-05-11 15:02 ` [PATCH 2/2] ext4: annotate all meta data requests Saugata Das
@ 2012-05-14  1:42 ` Namhyung Kim
  2012-05-14  4:54   ` Saugata Das
  2012-05-16 11:57 ` Saugata Das
  2012-05-16 12:32 ` Boaz Harrosh
  3 siblings, 1 reply; 7+ messages in thread
From: Namhyung Kim @ 2012-05-14  1:42 UTC (permalink / raw)
  To: Saugata Das
  Cc: linux-ext4, linux-fsdevel, tytso, adilger, hch, arnd.bergmann,
	venkat, Saugata Das

Hi,

On Fri, 11 May 2012 20:32:56 +0530, Saugata Das wrote:
> From: Saugata Das <saugata.das@linaro.org>
>
> Today, storage devices like eMMC has special features like data tagging
> (introduced in MMC-4.5 version) in order to improve performance of some
> specific writes. On MMC stack, data tagging is used for all writes which
> has REQ_META flag set. This patch adds the capability to add REQ_META flag
> during meta data write.
>

AFAIK, the REQ_META is only for marking a bio/req to be recognized when
using blktrace or something. You can use REQ_PRIO for the purpose but it
applies only if your ioscheduler is CFQ.

But I'm not aware how the MMC stack works, so I might be missing something.

Thanks,
Namhyung


> Signed-off-by: Saugata Das <saugata.das@linaro.org>
> ---
>  fs/buffer.c                 |   10 ++++++++--
>  include/linux/buffer_head.h |    2 ++
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 36d6665..688b38b 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
>  	do {
>  		struct buffer_head *next = bh->b_this_page;
>  		if (buffer_async_write(bh)) {
> -			submit_bh(write_op, bh);
> +			if (buffer_meta(bh))
> +				submit_bh(write_op | REQ_META, bh);
> +			else
> +				submit_bh(write_op, bh);
>  			nr_underway++;
>  		}
>  		bh = next;
> @@ -1739,7 +1742,10 @@ recover:
>  		struct buffer_head *next = bh->b_this_page;
>  		if (buffer_async_write(bh)) {
>  			clear_buffer_dirty(bh);
> -			submit_bh(write_op, bh);
> +			if (buffer_meta(bh))
> +				submit_bh(write_op | REQ_META, bh);
> +			else
> +				submit_bh(write_op, bh);
>  			nr_underway++;
>  		}
>  		bh = next;
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index ef26043..0776564 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -34,6 +34,7 @@ enum bh_state_bits {
>  	BH_Write_EIO,	/* I/O error on write */
>  	BH_Unwritten,	/* Buffer is allocated on disk but not written */
>  	BH_Quiet,	/* Buffer Error Prinks to be quiet */
> +	BH_Meta,	/* Is meta */
>  
>  	BH_PrivateStart,/* not a state bit, but the first bit available
>  			 * for private allocation by other entities
> @@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
>  BUFFER_FNS(Boundary, boundary)
>  BUFFER_FNS(Write_EIO, write_io_error)
>  BUFFER_FNS(Unwritten, unwritten)
> +BUFFER_FNS(Meta, meta)
>  
>  #define bh_offset(bh)		((unsigned long)(bh)->b_data & ~PAGE_MASK)
>  #define touch_buffer(bh)	mark_page_accessed(bh->b_page)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] block: add BH_Meta flag
  2012-05-14  1:42 ` [PATCH 1/2] block: add BH_Meta flag Namhyung Kim
@ 2012-05-14  4:54   ` Saugata Das
  0 siblings, 0 replies; 7+ messages in thread
From: Saugata Das @ 2012-05-14  4:54 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Saugata Das, linux-ext4, linux-fsdevel, tytso, adilger, hch,
	arnd.bergmann, venkat

On 14 May 2012 07:12, Namhyung Kim <namhyung.kim@lge.com> wrote:
> Hi,
>
> On Fri, 11 May 2012 20:32:56 +0530, Saugata Das wrote:
>> From: Saugata Das <saugata.das@linaro.org>
>>
>> Today, storage devices like eMMC has special features like data tagging
>> (introduced in MMC-4.5 version) in order to improve performance of some
>> specific writes. On MMC stack, data tagging is used for all writes which
>> has REQ_META flag set. This patch adds the capability to add REQ_META flag
>> during meta data write.
>>
>
> AFAIK, the REQ_META is only for marking a bio/req to be recognized when
> using blktrace or something. You can use REQ_PRIO for the purpose but it
> applies only if your ioscheduler is CFQ.
>
> But I'm not aware how the MMC stack works, so I might be missing something.
>

Today on ext4, REQ_META or REQ_PRIO are only used during read
operation. For meta-data writes, no special flag (REQ_META or
REQ_PRIO) is set.

On eMMC, we depend on REQ_META flag to implement the "reliable write"
and "data tag" feature, which are linked with additional reliability
and performance for file system meta-data writes.


> Thanks,
> Namhyung
>
>
>> Signed-off-by: Saugata Das <saugata.das@linaro.org>
>> ---
>>  fs/buffer.c                 |   10 ++++++++--
>>  include/linux/buffer_head.h |    2 ++
>>  2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/buffer.c b/fs/buffer.c
>> index 36d6665..688b38b 100644
>> --- a/fs/buffer.c
>> +++ b/fs/buffer.c
>> @@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
>>       do {
>>               struct buffer_head *next = bh->b_this_page;
>>               if (buffer_async_write(bh)) {
>> -                     submit_bh(write_op, bh);
>> +                     if (buffer_meta(bh))
>> +                             submit_bh(write_op | REQ_META, bh);
>> +                     else
>> +                             submit_bh(write_op, bh);
>>                       nr_underway++;
>>               }
>>               bh = next;
>> @@ -1739,7 +1742,10 @@ recover:
>>               struct buffer_head *next = bh->b_this_page;
>>               if (buffer_async_write(bh)) {
>>                       clear_buffer_dirty(bh);
>> -                     submit_bh(write_op, bh);
>> +                     if (buffer_meta(bh))
>> +                             submit_bh(write_op | REQ_META, bh);
>> +                     else
>> +                             submit_bh(write_op, bh);
>>                       nr_underway++;
>>               }
>>               bh = next;
>> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
>> index ef26043..0776564 100644
>> --- a/include/linux/buffer_head.h
>> +++ b/include/linux/buffer_head.h
>> @@ -34,6 +34,7 @@ enum bh_state_bits {
>>       BH_Write_EIO,   /* I/O error on write */
>>       BH_Unwritten,   /* Buffer is allocated on disk but not written */
>>       BH_Quiet,       /* Buffer Error Prinks to be quiet */
>> +     BH_Meta,        /* Is meta */
>>
>>       BH_PrivateStart,/* not a state bit, but the first bit available
>>                        * for private allocation by other entities
>> @@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
>>  BUFFER_FNS(Boundary, boundary)
>>  BUFFER_FNS(Write_EIO, write_io_error)
>>  BUFFER_FNS(Unwritten, unwritten)
>> +BUFFER_FNS(Meta, meta)
>>
>>  #define bh_offset(bh)                ((unsigned long)(bh)->b_data & ~PAGE_MASK)
>>  #define touch_buffer(bh)     mark_page_accessed(bh->b_page)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] block: add BH_Meta flag
  2012-05-11 15:02 [PATCH 1/2] block: add BH_Meta flag Saugata Das
  2012-05-11 15:02 ` [PATCH 2/2] ext4: annotate all meta data requests Saugata Das
  2012-05-14  1:42 ` [PATCH 1/2] block: add BH_Meta flag Namhyung Kim
@ 2012-05-16 11:57 ` Saugata Das
  2012-05-16 12:32 ` Boaz Harrosh
  3 siblings, 0 replies; 7+ messages in thread
From: Saugata Das @ 2012-05-16 11:57 UTC (permalink / raw)
  To: tytso, hch
  Cc: adilger, arnd.bergmann, venkat, Deepak Saxena,
	Saugata Das PURKAYASTHA, linux-ext4, linux-fsdevel

Hi Ted, Christoph

Will you please comment on the following patch set,
[PATCH 1/2] block: add BH_Meta flag
[PATCH 2/2] ext4: annotate all meta data requests

If there is no remark, then will you please merge them to the next version.


Thanks,
Saugata


On 11 May 2012 20:32, Saugata Das <saugata.das@stericsson.com> wrote:
> From: Saugata Das <saugata.das@linaro.org>
>
> Today, storage devices like eMMC has special features like data tagging
> (introduced in MMC-4.5 version) in order to improve performance of some
> specific writes. On MMC stack, data tagging is used for all writes which
> has REQ_META flag set. This patch adds the capability to add REQ_META flag
> during meta data write.
>
> Signed-off-by: Saugata Das <saugata.das@linaro.org>
> ---
>  fs/buffer.c                 |   10 ++++++++--
>  include/linux/buffer_head.h |    2 ++
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 36d6665..688b38b 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
>        do {
>                struct buffer_head *next = bh->b_this_page;
>                if (buffer_async_write(bh)) {
> -                       submit_bh(write_op, bh);
> +                       if (buffer_meta(bh))
> +                               submit_bh(write_op | REQ_META, bh);
> +                       else
> +                               submit_bh(write_op, bh);
>                        nr_underway++;
>                }
>                bh = next;
> @@ -1739,7 +1742,10 @@ recover:
>                struct buffer_head *next = bh->b_this_page;
>                if (buffer_async_write(bh)) {
>                        clear_buffer_dirty(bh);
> -                       submit_bh(write_op, bh);
> +                       if (buffer_meta(bh))
> +                               submit_bh(write_op | REQ_META, bh);
> +                       else
> +                               submit_bh(write_op, bh);
>                        nr_underway++;
>                }
>                bh = next;
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index ef26043..0776564 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -34,6 +34,7 @@ enum bh_state_bits {
>        BH_Write_EIO,   /* I/O error on write */
>        BH_Unwritten,   /* Buffer is allocated on disk but not written */
>        BH_Quiet,       /* Buffer Error Prinks to be quiet */
> +       BH_Meta,        /* Is meta */
>
>        BH_PrivateStart,/* not a state bit, but the first bit available
>                         * for private allocation by other entities
> @@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
>  BUFFER_FNS(Boundary, boundary)
>  BUFFER_FNS(Write_EIO, write_io_error)
>  BUFFER_FNS(Unwritten, unwritten)
> +BUFFER_FNS(Meta, meta)
>
>  #define bh_offset(bh)          ((unsigned long)(bh)->b_data & ~PAGE_MASK)
>  #define touch_buffer(bh)       mark_page_accessed(bh->b_page)
> --
> 1.7.4.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] block: add BH_Meta flag
  2012-05-11 15:02 [PATCH 1/2] block: add BH_Meta flag Saugata Das
                   ` (2 preceding siblings ...)
  2012-05-16 11:57 ` Saugata Das
@ 2012-05-16 12:32 ` Boaz Harrosh
  2012-05-16 14:06   ` Saugata Das
  3 siblings, 1 reply; 7+ messages in thread
From: Boaz Harrosh @ 2012-05-16 12:32 UTC (permalink / raw)
  To: Saugata Das
  Cc: linux-ext4, linux-fsdevel, tytso, adilger, hch, arnd.bergmann,
	venkat, Saugata Das

On 05/11/2012 06:02 PM, Saugata Das wrote:

> From: Saugata Das <saugata.das@linaro.org>
> 
> Today, storage devices like eMMC has special features like data tagging
> (introduced in MMC-4.5 version) in order to improve performance of some
> specific writes. On MMC stack, data tagging is used for all writes which
> has REQ_META flag set. This patch adds the capability to add REQ_META flag
> during meta data write.
> 
> Signed-off-by: Saugata Das <saugata.das@linaro.org>
> ---
>  fs/buffer.c                 |   10 ++++++++--
>  include/linux/buffer_head.h |    2 ++
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 36d6665..688b38b 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
>  	do {
>  		struct buffer_head *next = bh->b_this_page;
>  		if (buffer_async_write(bh)) {
> -			submit_bh(write_op, bh);
> +			if (buffer_meta(bh))
> +				submit_bh(write_op | REQ_META, bh);
> +			else
> +				submit_bh(write_op, bh);


Its not nice to duplicate a call site for the parameter difference
it's better to change the parameter and call the function in one
place. (an assembler call site can get big)

You can do:
+				submit_bh(write_op | (buffer_meta(bh) << __REQ_META), bh);

And also avoid a conditional inside a loop.


>  			nr_underway++;
>  		}
>  		bh = next;
> @@ -1739,7 +1742,10 @@ recover:
>  		struct buffer_head *next = bh->b_this_page;
>  		if (buffer_async_write(bh)) {
>  			clear_buffer_dirty(bh);
> -			submit_bh(write_op, bh);
> +			if (buffer_meta(bh))
> +				submit_bh(write_op | REQ_META, bh);
> +			else
> +				submit_bh(write_op, bh);


Here too

Boaz

>  			nr_underway++;
>  		}
>  		bh = next;
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index ef26043..0776564 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -34,6 +34,7 @@ enum bh_state_bits {
>  	BH_Write_EIO,	/* I/O error on write */
>  	BH_Unwritten,	/* Buffer is allocated on disk but not written */
>  	BH_Quiet,	/* Buffer Error Prinks to be quiet */
> +	BH_Meta,	/* Is meta */
>  
>  	BH_PrivateStart,/* not a state bit, but the first bit available
>  			 * for private allocation by other entities
> @@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
>  BUFFER_FNS(Boundary, boundary)
>  BUFFER_FNS(Write_EIO, write_io_error)
>  BUFFER_FNS(Unwritten, unwritten)
> +BUFFER_FNS(Meta, meta)
>  
>  #define bh_offset(bh)		((unsigned long)(bh)->b_data & ~PAGE_MASK)
>  #define touch_buffer(bh)	mark_page_accessed(bh->b_page)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] block: add BH_Meta flag
  2012-05-16 12:32 ` Boaz Harrosh
@ 2012-05-16 14:06   ` Saugata Das
  0 siblings, 0 replies; 7+ messages in thread
From: Saugata Das @ 2012-05-16 14:06 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Saugata Das, linux-ext4, linux-fsdevel, tytso, adilger, hch,
	arnd.bergmann, venkat

On 16 May 2012 18:02, Boaz Harrosh <bharrosh@panasas.com> wrote:
> On 05/11/2012 06:02 PM, Saugata Das wrote:
>
>> From: Saugata Das <saugata.das@linaro.org>
>>
>> Today, storage devices like eMMC has special features like data tagging
>> (introduced in MMC-4.5 version) in order to improve performance of some
>> specific writes. On MMC stack, data tagging is used for all writes which
>> has REQ_META flag set. This patch adds the capability to add REQ_META flag
>> during meta data write.
>>
>> Signed-off-by: Saugata Das <saugata.das@linaro.org>
>> ---
>>  fs/buffer.c                 |   10 ++++++++--
>>  include/linux/buffer_head.h |    2 ++
>>  2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/buffer.c b/fs/buffer.c
>> index 36d6665..688b38b 100644
>> --- a/fs/buffer.c
>> +++ b/fs/buffer.c
>> @@ -1685,7 +1685,10 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
>>       do {
>>               struct buffer_head *next = bh->b_this_page;
>>               if (buffer_async_write(bh)) {
>> -                     submit_bh(write_op, bh);
>> +                     if (buffer_meta(bh))
>> +                             submit_bh(write_op | REQ_META, bh);
>> +                     else
>> +                             submit_bh(write_op, bh);
>
>
> Its not nice to duplicate a call site for the parameter difference
> it's better to change the parameter and call the function in one
> place. (an assembler call site can get big)
>
> You can do:
> +                               submit_bh(write_op | (buffer_meta(bh) << __REQ_META), bh);
>
> And also avoid a conditional inside a loop.
>

Thanks for your comments. I will take care of this in the next version.


>
>>                       nr_underway++;
>>               }
>>               bh = next;
>> @@ -1739,7 +1742,10 @@ recover:
>>               struct buffer_head *next = bh->b_this_page;
>>               if (buffer_async_write(bh)) {
>>                       clear_buffer_dirty(bh);
>> -                     submit_bh(write_op, bh);
>> +                     if (buffer_meta(bh))
>> +                             submit_bh(write_op | REQ_META, bh);
>> +                     else
>> +                             submit_bh(write_op, bh);
>
>
> Here too
>
> Boaz
>
>>                       nr_underway++;
>>               }
>>               bh = next;
>> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
>> index ef26043..0776564 100644
>> --- a/include/linux/buffer_head.h
>> +++ b/include/linux/buffer_head.h
>> @@ -34,6 +34,7 @@ enum bh_state_bits {
>>       BH_Write_EIO,   /* I/O error on write */
>>       BH_Unwritten,   /* Buffer is allocated on disk but not written */
>>       BH_Quiet,       /* Buffer Error Prinks to be quiet */
>> +     BH_Meta,        /* Is meta */
>>
>>       BH_PrivateStart,/* not a state bit, but the first bit available
>>                        * for private allocation by other entities
>> @@ -126,6 +127,7 @@ BUFFER_FNS(Delay, delay)
>>  BUFFER_FNS(Boundary, boundary)
>>  BUFFER_FNS(Write_EIO, write_io_error)
>>  BUFFER_FNS(Unwritten, unwritten)
>> +BUFFER_FNS(Meta, meta)
>>
>>  #define bh_offset(bh)                ((unsigned long)(bh)->b_data & ~PAGE_MASK)
>>  #define touch_buffer(bh)     mark_page_accessed(bh->b_page)
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-16 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 15:02 [PATCH 1/2] block: add BH_Meta flag Saugata Das
2012-05-11 15:02 ` [PATCH 2/2] ext4: annotate all meta data requests Saugata Das
2012-05-14  1:42 ` [PATCH 1/2] block: add BH_Meta flag Namhyung Kim
2012-05-14  4:54   ` Saugata Das
2012-05-16 11:57 ` Saugata Das
2012-05-16 12:32 ` Boaz Harrosh
2012-05-16 14:06   ` Saugata Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.