All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: "Toralf Förster" <toralf.foerster@gmx.de>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH 2/2] mm: readahead: handle LARGE input to get_init_ra_size()
Date: Tue, 29 Dec 2020 10:11:11 -0800	[thread overview]
Message-ID: <1f5a6e7b-c779-861e-fde8-409ca8e2541b@infradead.org> (raw)
In-Reply-To: <d2edfb69-93b4-d938-faf0-5f7c0f1158b9@gmx.de>

On 12/29/20 10:01 AM, Toralf Förster wrote:
> On 12/23/20 2:50 AM, Randy Dunlap wrote:
>>> What motivates this change?  Is there any reason to think this can
>>> happen?
>> Spotted in the wild:
> I run 2 hardened Gentoo systems, a server and a desktop.
> 
> I patched the server with this:
> 
> mr-fox ~ # cat ubsan.patch
> --- linux-5.10.1.orig/mm/readahead.c
> +++ linux-5.10.1/mm/readahead.c
> @@ -310,7 +310,11 @@ void force_page_cache_ra(struct readahea
>   */
>  static unsigned long get_init_ra_size(unsigned long size, unsigned
> long max)
>  {
> -       unsigned long newsize = roundup_pow_of_two(size);
> +       unsigned long newsize;
> +
> +       if (!size)
> +               size = 32;
> +       newsize = roundup_pow_of_two(size);
> 
>         if (newsize <= max / 32)
>                 newsize = newsize * 4;
> 
> 
> 
> and the issue did no longer occurred at the server (5.10.2).
> 
> I did not patched the desktop system and the issue occurred still 3
> times since 21th of december (5.10.2/3)

Yes, that's the patch that I posted on 2020-DEC-22.

Looks like I should submit a real patch for that.

thanks.
-- 
~Randy


  reply	other threads:[~2020-12-29 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 21:10 [RFC PATCH 2/2] mm: readahead: handle LARGE input to get_init_ra_size() Randy Dunlap
2020-12-23  1:35 ` Andrew Morton
2020-12-23  1:50   ` Randy Dunlap
2020-12-29 18:01     ` Toralf Förster
2020-12-29 18:11       ` Randy Dunlap [this message]
2020-12-29 20:00         ` Randy Dunlap
2020-12-29 20:46           ` Toralf Förster

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=1f5a6e7b-c779-861e-fde8-409ca8e2541b@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=toralf.foerster@gmx.de \
    /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.