FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 05-19-2011, 04:57 PM
Mikulas Patocka
 
Default dm-io: reserve just one bioset structure

dm-io: reserve just one bioset structure

The number 16 was "magic" and meaningless. This patch changes it to reserve just
one "struct bio", which is the minimum required.

If there is no memory pressure, the code can allocate arbitrary number of bios.

If there is memory pressure, the code can allocate just one bio. The code in
"do_region" contains a loop, it allocates a bio, fills it and submits it. If we
have just one bio available, the code wouldn't deadlock, it would just wait
with the allocation of next bio until the previous bio finished.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.39-rc7-fast/drivers/md/dm-io.c
================================================== =================
--- linux-2.6.39-rc7-fast.orig/drivers/md/dm-io.c 2011-05-18 20:51:32.000000000 +0200
+++ linux-2.6.39-rc7-fast/drivers/md/dm-io.c 2011-05-18 20:51:37.000000000 +0200
@@ -57,7 +57,7 @@ struct dm_io_client *dm_io_client_create
if (!client->pool)
goto bad;

- client->bios = bioset_create(16, 0);
+ client->bios = bioset_create(1, 0);
if (!client->bios)
goto bad;


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-19-2011, 04:57 PM
Mikulas Patocka
 
Default dm-io: reserve just one bioset structure

dm-io: reserve just one bioset structure

The number 16 was "magic" and meaningless. This patch changes it to reserve just
one "struct bio", which is the minimum required.

If there is no memory pressure, the code can allocate arbitrary number of bios.

If there is memory pressure, the code can allocate just one bio. The code in
"do_region" contains a loop, it allocates a bio, fills it and submits it. If we
have just one bio available, the code wouldn't deadlock, it would just wait
with the allocation of next bio until the previous bio finished.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.39-rc7-fast/drivers/md/dm-io.c
================================================== =================
--- linux-2.6.39-rc7-fast.orig/drivers/md/dm-io.c 2011-05-18 20:51:32.000000000 +0200
+++ linux-2.6.39-rc7-fast/drivers/md/dm-io.c 2011-05-18 20:51:37.000000000 +0200
@@ -57,7 +57,7 @@ struct dm_io_client *dm_io_client_create
if (!client->pool)
goto bad;

- client->bios = bioset_create(16, 0);
+ client->bios = bioset_create(1, 0);
if (!client->bios)
goto bad;


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 10:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org