Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9983008pxu; Tue, 29 Dec 2020 10:14:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFbC2iJU5CjwH/tAHgupmoIUBdoKK23oiBcsVZYtY+Xm8ROy12D8tnungEiKydYNXuwCl1 X-Received: by 2002:a17:907:980e:: with SMTP id ji14mr14092698ejc.462.1609265654797; Tue, 29 Dec 2020 10:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609265654; cv=none; d=google.com; s=arc-20160816; b=cry17SgSvdv3G5u9C6acCB3Cz2VjvzDQdY8NXMntt8EW+mSNP1EtFtdm1YW7pEHo/X FPsdEFOm/Gq/ni83Fh9qi6GNDRg8VSd1FIJ3JDvu8fPyCzy6WltDCF85032xqSWEthq0 sZadDhu98OWaelWW51jQFYFL0ZSArZWesZUgQC2TMHTxYqE4/9q7Pf/h13+zugXv3bHx dIy4IvcnyMdflM111BinPbJwDRHMVegWzvh3w9DuBpWGIXlqdW61y08Rqi5juNOAI475 pBx8+TDA6EuAUPqUD59uhhzE6AEacg2cCfshy4ME3CW9R64QzgfTlpuu5CH2Ag/VfLVb koYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=viV2rX2w2i9Hdm9ONoTqTJFY2cOrENzdsrkBg4PRr5I=; b=rJIk4E3oN7taZtQS0SzNO5DiXxdzQ+UM6yII9J4L+sZ7oa2qtv+VUdxT6cCs/LGvzu Or1zcWJL2r3AKK5JNNbnZ6Q5VqxActZFACtjNREEpJonMKiO29RuQUwnbCLw89fD1Ff/ gMG32GpIhWtSGRp9iEXA1PZ3a5wNQtg4GSsvHvBNzQWM2HLDssbW0awxmmjtvfL9lXWw 1HEu3vufEUPhyeouDG4XOtpYrage1fALG4pPowcsQsMbBWvMQtW496LdBSgEBzHsMUmK WunxRLrwYKIwi7yBfGXgGRn2cbseI/6JK3k0+oP/h7zwaBNbf41vc5tqMH+aUcuKEsk0 0P6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=0WfJGaCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si23151566edk.411.2020.12.29.10.13.51; Tue, 29 Dec 2020 10:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=0WfJGaCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbgL2SMF (ORCPT + 99 others); Tue, 29 Dec 2020 13:12:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbgL2SMF (ORCPT ); Tue, 29 Dec 2020 13:12:05 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15BB7C061574 for ; Tue, 29 Dec 2020 10:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=viV2rX2w2i9Hdm9ONoTqTJFY2cOrENzdsrkBg4PRr5I=; b=0WfJGaCXCUrUAefVlFICv4ymRr YI+ZcwDuluq7ussSVYQn0C3pjBbJX80DPtG0sMPBHFFJJG+o0s3SIq6KYzsmHVT6XHo/czVUixzw4 9s/VsFvCRO2fVLyND9RVCr6RKtT1pQ67041UKS3ORBNdzwUS+ukIwsKgVQs2IsEEsOP0J7OGEjBjK rrz/IBNvMyOsLYMabG3Y7vl/i3Ro9junBMg+zYBnJuBRhTPK1ez6Vd8AAwdek/owHP0aIWpXEcbZh uc+zfHt6BUmHlTMJQmCB7nmnNe04LaVaJkctJmYX8iVDFa5LZwOsNx5QOWdIBq4A/bvDs+73iZV4a B1Ji1YFg==; Received: from [2601:1c0:6280:3f0::2c43] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuJSo-0003sk-Ry; Tue, 29 Dec 2020 18:11:19 +0000 Subject: Re: [RFC PATCH 2/2] mm: readahead: handle LARGE input to get_init_ra_size() To: =?UTF-8?Q?Toralf_F=c3=b6rster?= , Andrew Morton Cc: linux-kernel@vger.kernel.org, Jens Axboe , linux-mm@kvack.org References: <20201220211051.1416-1-rdunlap@infradead.org> <20201222173533.c9e28416835d7487b0e28cda@linux-foundation.org> <6a595671-20a8-e63f-f3ea-f4749a574efa@infradead.org> From: Randy Dunlap Message-ID: <1f5a6e7b-c779-861e-fde8-409ca8e2541b@infradead.org> Date: Tue, 29 Dec 2020 10:11:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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