dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [dm-devel] [PATCH] dm-writecache: commit just one block, not a full page
@ 2021-06-06 20:13 Mikulas Patocka
  2021-06-07 18:57 ` Heinz Mauelshagen
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2021-06-06 20:13 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel

When comitting superblock, we need to write just one block, we don't need
to write full page. Some architectures have pages larger than 4k and
committing full page is needless overhead.

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

Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c
+++ linux-2.6/drivers/md/dm-writecache.c
@@ -532,11 +532,7 @@ static void ssd_commit_superblock(struct
 
 	region.bdev = wc->ssd_dev->bdev;
 	region.sector = 0;
-	region.count = PAGE_SIZE >> SECTOR_SHIFT;
-
-	if (unlikely(region.sector + region.count > wc->metadata_sectors))
-		region.count = wc->metadata_sectors - region.sector;
-
+	region.count = wc->block_size >> SECTOR_SHIFT;
 	region.sector += wc->start_sector;
 
 	req.bi_op = REQ_OP_WRITE;

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


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

* Re: [dm-devel] [PATCH] dm-writecache: commit just one block, not a full page
  2021-06-06 20:13 [dm-devel] [PATCH] dm-writecache: commit just one block, not a full page Mikulas Patocka
@ 2021-06-07 18:57 ` Heinz Mauelshagen
  0 siblings, 0 replies; 2+ messages in thread
From: Heinz Mauelshagen @ 2021-06-07 18:57 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: Mike Snitzer, dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 1169 bytes --]

On Sun, Jun 6, 2021 at 10:14 PM Mikulas Patocka <mpatocka@redhat.com> wrote:

> When comitting superblock, we need to write just one block, we don't need
> to write full page. Some architectures have pages larger than 4k and
> committing full page is needless overhead.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> Index: linux-2.6/drivers/md/dm-writecache.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/dm-writecache.c
> +++ linux-2.6/drivers/md/dm-writecache.c
> @@ -532,11 +532,7 @@ static void ssd_commit_superblock(struct
>
>         region.bdev = wc->ssd_dev->bdev;
>         region.sector = 0;
> -       region.count = PAGE_SIZE >> SECTOR_SHIFT;
> -
> -       if (unlikely(region.sector + region.count > wc->metadata_sectors))
> -               region.count = wc->metadata_sectors - region.sector;
> -
> +       region.count = wc->block_size >> SECTOR_SHIFT;
>

You can use to_sector() here.


>         region.sector += wc->start_sector;
>
>         req.bi_op = REQ_OP_WRITE;
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://listman.redhat.com/mailman/listinfo/dm-devel
>
>

[-- Attachment #1.2: Type: text/html, Size: 1978 bytes --]

[-- Attachment #2: Type: text/plain, Size: 97 bytes --]

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

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

end of thread, other threads:[~2021-06-07 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 20:13 [dm-devel] [PATCH] dm-writecache: commit just one block, not a full page Mikulas Patocka
2021-06-07 18:57 ` Heinz Mauelshagen

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).