All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
@ 2018-10-25 16:09 Rui Salvaterra
  2018-10-26  2:00 ` Ming Lei
  2018-10-26  6:27 ` Ming Lei
  0 siblings, 2 replies; 7+ messages in thread
From: Rui Salvaterra @ 2018-10-25 16:09 UTC (permalink / raw)
  To: ming.lei, axboe; +Cc: linux-block, linux-kernel

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.

Thanks,

Rui

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
  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
  2018-10-26  6:27 ` Ming Lei
  1 sibling, 0 replies; 7+ messages in thread
From: Ming Lei @ 2018-10-26  2:00 UTC (permalink / raw)
  To: Rui Salvaterra; +Cc: axboe, linux-block, linux-kernel

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

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
  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
@ 2018-10-26  6:27 ` Ming Lei
  2018-10-26  7:50   ` Rui Salvaterra
  1 sibling, 1 reply; 7+ messages in thread
From: Ming Lei @ 2018-10-26  6:27 UTC (permalink / raw)
  To: Rui Salvaterra; +Cc: axboe, linux-block, linux-kernel

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 patch titled with 'block: make sure discard bio is aligned with logical block size'
in the list may fix this issue, please test and see if it works.

Thanks,
Ming

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
  2018-10-26  6:27 ` Ming Lei
@ 2018-10-26  7:50   ` Rui Salvaterra
  2018-10-28  1:01     ` Ming Lei
  0 siblings, 1 reply; 7+ messages in thread
From: Rui Salvaterra @ 2018-10-26  7:50 UTC (permalink / raw)
  To: ming.lei; +Cc: axboe, linux-block, linux-kernel

On Fri, 26 Oct 2018 at 07:27, Ming Lei <ming.lei@redhat.com> wrote:
>
> The patch titled with 'block: make sure discard bio is aligned with logical block size'
> in the list may fix this issue, please test and see if it works.
>
> Thanks,
> Ming

Hi, Ming,

Thanks for the quick reply. Unfortunately, it doesn't seem to apply
cleanly to 4.19. To which tree/tag/commit should I apply the series?

Thanks,

Rui

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
  2018-10-26  7:50   ` Rui Salvaterra
@ 2018-10-28  1:01     ` Ming Lei
  2018-10-28  8:53         ` Rui Salvaterra
  0 siblings, 1 reply; 7+ messages in thread
From: Ming Lei @ 2018-10-28  1:01 UTC (permalink / raw)
  To: Rui Salvaterra; +Cc: axboe, linux-block, linux-kernel

On Fri, Oct 26, 2018 at 08:50:20AM +0100, Rui Salvaterra wrote:
> On Fri, 26 Oct 2018 at 07:27, Ming Lei <ming.lei@redhat.com> wrote:
> >
> > The patch titled with 'block: make sure discard bio is aligned with logical block size'
> > in the list may fix this issue, please test and see if it works.
> >
> > Thanks,
> > Ming
> 
> Hi, Ming,
> 
> Thanks for the quick reply. Unfortunately, it doesn't seem to apply
> cleanly to 4.19. To which tree/tag/commit should I apply the series?

The whole patchset is against linus tree (44786880df196a4200).

I am sure that the 1st patch can be applied cleanly against v4.19, and
it is enough for fixing this issue, please double check.

[ming@ming linux]$ git log --oneline -1
84df9525b0c2 Linux 4.19
[ming@ming linux]$ git am ~/emails/blk/181026\ \[PATCH\ 1∕3\]\ block\:\ make\ sure\ discard\ bio\ is\ aligned\ with\ logical\ block\ size.eml
Applying: block: make sure discard bio is aligned with logical block size
[ming@ming linux]$ 


Thanks,
Ming

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
  2018-10-28  1:01     ` Ming Lei
@ 2018-10-28  8:53         ` Rui Salvaterra
  0 siblings, 0 replies; 7+ messages in thread
From: Rui Salvaterra @ 2018-10-28  8:53 UTC (permalink / raw)
  To: ming.lei; +Cc: axboe, linux-block, linux-kernel

On Sun, 28 Oct 2018 at 01:02, Ming Lei <ming.lei@redhat.com> wrote:
>
> On Fri, Oct 26, 2018 at 08:50:20AM +0100, Rui Salvaterra wrote:
> > On Fri, 26 Oct 2018 at 07:27, Ming Lei <ming.lei@redhat.com> wrote:
> > >
> > > The patch titled with 'block: make sure discard bio is aligned with l=
ogical block size'
> > > in the list may fix this issue, please test and see if it works.
> > >
> > > Thanks,
> > > Ming
> >
> > Hi, Ming,
> >
> > Thanks for the quick reply. Unfortunately, it doesn't seem to apply
> > cleanly to 4.19. To which tree/tag/commit should I apply the series?
>
> The whole patchset is against linus tree (44786880df196a4200).
>
> I am sure that the 1st patch can be applied cleanly against v4.19, and
> it is enough for fixing this issue, please double check.
>
> [ming@ming linux]$ git log --oneline -1
> 84df9525b0c2 Linux 4.19
> [ming@ming linux]$ git am ~/emails/blk/181026\ \[PATCH\ 1=E2=88=953\]\ bl=
ock\:\ make\ sure\ discard\ bio\ is\ aligned\ with\ logical\ block\ size.em=
l
> Applying: block: make sure discard bio is aligned with logical block size
> [ming@ming linux]$
>
>
> Thanks,
> Ming

Hi, Ming,

You're, right, of course. I had reverted the aforementioned commit, so
the patch set obviously wouldn't apply anymore. After checking out
v4.19 again, everything went smoothly. I confirm the patch set fixes
the issue for me, which means this series is

Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>

Thanks again,

Rui

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

* Re: Bug: swap discard issue with zram caused by "block: don't deal with discard limit in blkdev_issue_discard()"
@ 2018-10-28  8:53         ` Rui Salvaterra
  0 siblings, 0 replies; 7+ messages in thread
From: Rui Salvaterra @ 2018-10-28  8:53 UTC (permalink / raw)
  To: ming.lei; +Cc: axboe, linux-block, linux-kernel

On Sun, 28 Oct 2018 at 01:02, Ming Lei <ming.lei@redhat.com> wrote:
>
> On Fri, Oct 26, 2018 at 08:50:20AM +0100, Rui Salvaterra wrote:
> > On Fri, 26 Oct 2018 at 07:27, Ming Lei <ming.lei@redhat.com> wrote:
> > >
> > > The patch titled with 'block: make sure discard bio is aligned with logical block size'
> > > in the list may fix this issue, please test and see if it works.
> > >
> > > Thanks,
> > > Ming
> >
> > Hi, Ming,
> >
> > Thanks for the quick reply. Unfortunately, it doesn't seem to apply
> > cleanly to 4.19. To which tree/tag/commit should I apply the series?
>
> The whole patchset is against linus tree (44786880df196a4200).
>
> I am sure that the 1st patch can be applied cleanly against v4.19, and
> it is enough for fixing this issue, please double check.
>
> [ming@ming linux]$ git log --oneline -1
> 84df9525b0c2 Linux 4.19
> [ming@ming linux]$ git am ~/emails/blk/181026\ \[PATCH\ 1∕3\]\ block\:\ make\ sure\ discard\ bio\ is\ aligned\ with\ logical\ block\ size.eml
> Applying: block: make sure discard bio is aligned with logical block size
> [ming@ming linux]$
>
>
> Thanks,
> Ming

Hi, Ming,

You're, right, of course. I had reverted the aforementioned commit, so
the patch set obviously wouldn't apply anymore. After checking out
v4.19 again, everything went smoothly. I confirm the patch set fixes
the issue for me, which means this series is

Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>

Thanks again,

Rui

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

end of thread, other threads:[~2018-10-28  8:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
2018-10-28  8:53         ` Rui Salvaterra

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.