All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: preload block group descriptors
@ 2017-02-20 16:45 Artem Blagodarenko
  2017-02-28 16:19 ` Darrick J. Wong
  2017-04-30  4:54 ` Theodore Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Artem Blagodarenko @ 2017-02-20 16:45 UTC (permalink / raw)
  To: linux-ext4; +Cc: alexey.lyashkov, Andrew Perepechko

From: Andrew Perepechko <andrew.perepechko@seagate.com>

With enabled meta_bg option block group descriptors
reading IO is not sequential and requires optimization.

Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
---
 fs/ext4/super.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index a673558..0e52c91 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 
 	bgl_lock_init(sbi->s_blockgroup_lock);
 
+	/* Pre-read the descriptors into the buffer cache */
+	for (i = 0; i < db_count; i++) {
+		block = descriptor_loc(sb, logical_sb_block, i);
+		sb_breadahead(sb, block);
+	}
+
 	for (i = 0; i < db_count; i++) {
 		block = descriptor_loc(sb, logical_sb_block, i);
 		sbi->s_group_desc[i] = sb_bread_unmovable(sb, block);
-- 
1.8.3.1

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

* Re: [PATCH] ext4: preload block group descriptors
  2017-02-20 16:45 [PATCH] ext4: preload block group descriptors Artem Blagodarenko
@ 2017-02-28 16:19 ` Darrick J. Wong
  2017-02-28 16:29   ` Alexey Lyashkov
  2017-04-30  4:54 ` Theodore Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2017-02-28 16:19 UTC (permalink / raw)
  To: Artem Blagodarenko; +Cc: linux-ext4, alexey.lyashkov, Andrew Perepechko

On Mon, Feb 20, 2017 at 07:45:53PM +0300, Artem Blagodarenko wrote:
> From: Andrew Perepechko <andrew.perepechko@seagate.com>
> 
> With enabled meta_bg option block group descriptors
> reading IO is not sequential and requires optimization.
> 
> Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
> ---
>  fs/ext4/super.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index a673558..0e52c91 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  
>  	bgl_lock_init(sbi->s_blockgroup_lock);
>  
> +	/* Pre-read the descriptors into the buffer cache */
> +	for (i = 0; i < db_count; i++) {
> +		block = descriptor_loc(sb, logical_sb_block, i);
> +		sb_breadahead(sb, block);
> +	}

Why does the libext2fs patch start readahead only on the meta bgs
whereas this patch starts it for all of them?  I suppose it's just as
well that the kernel prefetches all of them, but I was curious. :)

--D

> +
>  	for (i = 0; i < db_count; i++) {
>  		block = descriptor_loc(sb, logical_sb_block, i);
>  		sbi->s_group_desc[i] = sb_bread_unmovable(sb, block);
> -- 
> 1.8.3.1
> 

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

* Re: [PATCH] ext4: preload block group descriptors
  2017-02-28 16:19 ` Darrick J. Wong
@ 2017-02-28 16:29   ` Alexey Lyashkov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Lyashkov @ 2017-02-28 16:29 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Artem Blagodarenko, linux-ext4, Andrew Perepechko


> 28 февр. 2017 г., в 19:19, Darrick J. Wong <darrick.wong@oracle.com> написал(а):
> 
> On Mon, Feb 20, 2017 at 07:45:53PM +0300, Artem Blagodarenko wrote:
>> From: Andrew Perepechko <andrew.perepechko@seagate.com>
>> 
>> With enabled meta_bg option block group descriptors
>> reading IO is not sequential and requires optimization.
>> 
>> Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
>> ---
>> fs/ext4/super.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
>> index a673558..0e52c91 100644
>> --- a/fs/ext4/super.c
>> +++ b/fs/ext4/super.c
>> @@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>> 
>> 	bgl_lock_init(sbi->s_blockgroup_lock);
>> 
>> +	/* Pre-read the descriptors into the buffer cache */
>> +	for (i = 0; i < db_count; i++) {
>> +		block = descriptor_loc(sb, logical_sb_block, i);
>> +		sb_breadahead(sb, block);
>> +	}
> 
> Why does the libext2fs patch start readahead only on the meta bgs
> whereas this patch starts it for all of them?  I suppose it's just as
> well that the kernel prefetches all of them, but I was curious. :)
> 
Just because a simplify code. 
libext2fs makes read a first gd porting via single read call, it fast.
while just meta_bg generate a random io load.
while a kernel part just a copy/paste a second loop :) Artem have a modified version for this patch,
when sb_bread_unmovable moved into ext4_check_descriptors to have chance increase window between read-ahead call and access to the buffer.
What about such change?


> --D
> 
>> +
>> 	for (i = 0; i < db_count; i++) {
>> 		block = descriptor_loc(sb, logical_sb_block, i);
>> 		sbi->s_group_desc[i] = sb_bread_unmovable(sb, block);
>> -- 
>> 1.8.3.1

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

* Re: [PATCH] ext4: preload block group descriptors
  2017-02-20 16:45 [PATCH] ext4: preload block group descriptors Artem Blagodarenko
  2017-02-28 16:19 ` Darrick J. Wong
@ 2017-04-30  4:54 ` Theodore Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2017-04-30  4:54 UTC (permalink / raw)
  To: Artem Blagodarenko; +Cc: linux-ext4, alexey.lyashkov, Andrew Perepechko

On Mon, Feb 20, 2017 at 07:45:53PM +0300, Artem Blagodarenko wrote:
> From: Andrew Perepechko <andrew.perepechko@seagate.com>
> 
> With enabled meta_bg option block group descriptors
> reading IO is not sequential and requires optimization.
> 
> Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>

Thanks, applied.

					- Ted

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

end of thread, other threads:[~2017-04-30  4:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 16:45 [PATCH] ext4: preload block group descriptors Artem Blagodarenko
2017-02-28 16:19 ` Darrick J. Wong
2017-02-28 16:29   ` Alexey Lyashkov
2017-04-30  4:54 ` Theodore Ts'o

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.