public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Rui Salvaterra <rsalvaterra@gmail.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
Date: Fri, 26 Oct 2018 10:00:35 +0800	[thread overview]
Message-ID: <20181026020034.GA25933@ming.t460p> (raw)
In-Reply-To: <CALjTZvapU2xc84D7Nqjk+vrF35cAOPzDTd6dRaXpuO=Lcap5Sg@mail.gmail.com>

On Thu, Oct 25, 2018 at 05:09:32PM +0100, Rui Salvaterra wrote:
> Hi,
> 
> After commit 744889b7cbb56a64f957e65ade7cb65fe3f35714, I started
> getting this (-EIO, it seems) on my dmesg:
> 
> swapon: discard_swap(00000000c275f02d): -5
> 
> This is an 8 GB zram swap device. It's configured like this:
> 
> modprobe zram
> echo zstd > /sys/block/zram0/comp_algorithm
> echo 8297508864 > /sys/block/zram0/disksize
> mkswap /dev/zram0
> swapon -d -p 100 /dev/zram0
> 
> I should note that if I use --discard=pages instead of -d (both
> policies) at swapon, I don't get this error.
> Reverting the commit from v4.19 final fixes the error for me, but
> surely breaks something else. :)
> Let me know if you need any additional information.

The reason is that zram doesn't call blk_queue_split() in .make_request_fn, :-(

Then the similar logic in blk_queue_split() has to be duplicated somewhere,
such as __blkdev_issue_discard().

I will post a patch for you soon.

Thanks,
Ming

  reply	other threads:[~2018-10-26  2:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 16:09 Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()" Rui Salvaterra
2018-10-26  2:00 ` Ming Lei [this message]
2018-10-26  6:27 ` Ming Lei
2018-10-26  7:50   ` Rui Salvaterra
2018-10-28  1:01     ` Ming Lei
2018-10-28  8:53       ` Rui Salvaterra

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=20181026020034.GA25933@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rsalvaterra@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox