All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <minchan@kernel.org>, <senozhatsky@chromium.org>
Cc: <axboe@kernel.dk>, <linux-block@vger.kernel.org>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 3/3] zram: add flush_dcache_page() call for write
Date: Fri, 12 May 2023 01:29:58 -0700	[thread overview]
Message-ID: <20230512082958.6550-4-kch@nvidia.com> (raw)
In-Reply-To: <20230512082958.6550-1-kch@nvidia.com>

Just like we have a call flush_dcache_read() after zrma_bvec_read(), add
missing flush_dcache_page() call before zram_bdev_write() in order to
handle the cache congruency of the kernel and userspace mappings of
page for REQ_OP_WRITE handling.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/block/zram/zram_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index fc37419b3735..a7954ae80d40 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1887,6 +1887,7 @@ static void zram_bio_rw(struct zram *zram, struct bio *bio)
 				SECTOR_SHIFT;
 
 		if (op_is_write(bio_op(bio))) {
+			flush_dcache_page(bv.bv_page);
 			ret = zram_bvec_write(zram, &bv, index, offset, bio);
 			if (ret < 0) {
 				atomic64_inc(&zram->stats.failed_writes);
-- 
2.40.0


  parent reply	other threads:[~2023-05-12  8:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12  8:29 [PATCH 0/3] zram: queue flag nowait and mior cleanup Chaitanya Kulkarni
2023-05-12  8:29 ` [PATCH 1/3] zram: allow user to set QUEUE_FLAG_NOWAIT Chaitanya Kulkarni
2023-05-12 14:31   ` Christoph Hellwig
2023-05-12 14:34     ` Jens Axboe
2023-05-13  1:06       ` Chaitanya Kulkarni
2023-05-16  5:51         ` Chaitanya Kulkarni
2023-05-16 13:08           ` Sergey Senozhatsky
2023-05-16 20:41             ` Chaitanya Kulkarni
2023-05-16 20:43               ` Jens Axboe
2023-05-16 21:32                 ` Chaitanya Kulkarni
2023-05-16 22:03                   ` Jens Axboe
2023-05-13  1:05     ` Chaitanya Kulkarni
2023-05-12  8:29 ` [PATCH 2/3] zram: consolidate zram_bio_read()_zram_bio_write() Chaitanya Kulkarni
2023-05-12 14:32   ` Christoph Hellwig
2023-05-13  1:06     ` Chaitanya Kulkarni
2023-05-12  8:29 ` Chaitanya Kulkarni [this message]
2023-05-12 14:34   ` [PATCH 3/3] zram: add flush_dcache_page() call for write Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230512082958.6550-4-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.