Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4166331ybi; Tue, 18 Jun 2019 13:03:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBbygHTg305/YSYzdyqsUjLTJnUeLSWen9FHWOuEVklJalPOAoGe/ahoAIjtZm1H4AAt9t X-Received: by 2002:a63:e304:: with SMTP id f4mr4190529pgh.187.1560888198353; Tue, 18 Jun 2019 13:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560888198; cv=none; d=google.com; s=arc-20160816; b=toKcrUilijO7yY68OXfTdrHjANkSBOyne92s0pmO/+mXYyYR1l7xtEqE4gjoteFhh8 5dLXSTIhUxwkmL3hb4XRVCSTm8jyA5Zxo2gdTrNmrf0d0qBhwuR4BW/G9+LVkeAvBJhR /SoTfoAb3q0473qYQQ8zHEYIbnSCTsndsiAJjvybMSj+sY4b8hGP7ZqrB5GRUjPW7gg0 OgV2Gr0QG2R/H11W0KCB+tXgPGEAE4mOFecy9fUIlnxxnyXkkv9eZnvk8zyxa5tMcRzp qHtZunwD0nJBBB+6vJ8N1qRJu2cLyrr4/cbMSS7yiruxB1lBMGwV/2GFok0e/LVRDzvN GpvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cVl3SIklS0nHd797FYY4cxHoZEAnPslNYDQOv5OhMDM=; b=YkNZ00rYX2m4kNSNF9kydBKw4VgWLCuibEhoYp0+lg4DNFyiGQCS4KH6JSGGaU7gXl H/xPKASpveJ3WqkGztAeVqzbJbEtuf9JMOfNYOj1BZuIkh+Hxfm2gSmJI8Hks37q0oWP zj/oTpuC3pXtMV2dSwCtsMzdO8VVTWk+tcyB07NjTwS8t3mQeEKqEvlpdOD8+K85s9Ab 3AzrhO+tW7ALEk6J6irjRA27o2mBI6Lw8nHLW+Fo/+rN1OV2uo1GOESuKzvI0JPeVIAr W2AsnGHJdY49H6heiBFPNjHSLebVL1iIL8BZzvtut4YCMnlNz/iRdnB/AVCq5bvIqU+O ww6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D4LqXjau; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r200si15275028pfc.281.2019.06.18.13.03.02; Tue, 18 Jun 2019 13:03:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D4LqXjau; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730403AbfFRUC6 (ORCPT + 99 others); Tue, 18 Jun 2019 16:02:58 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:39781 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730189AbfFRUC5 (ORCPT ); Tue, 18 Jun 2019 16:02:57 -0400 Received: by mail-lf1-f65.google.com with SMTP id p24so10253573lfo.6; Tue, 18 Jun 2019 13:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cVl3SIklS0nHd797FYY4cxHoZEAnPslNYDQOv5OhMDM=; b=D4LqXjauq6e8L92SXdCI8dBOeZ9g3qnR+MvRfoDQP4UPl32roBpvGWprF3TjlmHSja eZ/6/ZjWzgRN9htttHJTrPzVJCoFvbIqpDA3vC1Cl8utSLu6XzXuxp7AabXcEV/Om6He yHiGKcbb2hB4xqghyhAsPiwk4UDzPPVak57pe2KgOS495X1pgno1vQnCtMEqE80s7SDd b/xHq26uOBUeyQq+iykM4OWAPJ5VZU59856GZ2QUrHkBfHjmAmn1pe6xmy0ce97q8t4y IfDjJ3INQeQbB5asZ/xxIwCfBifBBZjV8Yfyh2WDBB5G9dWZfMSeieDwA07Xq9c2du8P K49g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cVl3SIklS0nHd797FYY4cxHoZEAnPslNYDQOv5OhMDM=; b=L+Mw5H2tzDvLIImNk+lqFdo/mYtJN4BEMzCzzEVGODbbeSfr7IGM+GLypvYdOAa6h/ Q1aoHhe40DvtMx2y5e9xNQb2TQ8T2ktYrDABU6RVhk+DZfGluuE1fMH+7mK0wDjpiXmE YJEdUTXMTwZKmbRxtrF5Qj54ZlEjaXd4roWCtbN1slPBmX2Y6x8bk2VOIYjp94Zf1hxY qBTwk50bQ3WKs0vdaXU6UDYuNp8PjibeZ3eM4s21gEu5f1aW8g3X/p9iTwGOw85OloTN 2XEhzpgUaBT7Q13MJ8XF91p8RQ1SDeZ3HMKYiwAX73D3huBEdcLePjTffCkD/VAols+b exSQ== X-Gm-Message-State: APjAAAVxactIGjKsD2BvM0z4i+IPMcbVsUSG7HWws/7qqjpGNpfhMg3a +bHSEg8wR1KH8veoIB64IqksEHY3BDA= X-Received: by 2002:a05:6512:29a:: with SMTP id j26mr26109062lfp.44.1560888175432; Tue, 18 Jun 2019 13:02:55 -0700 (PDT) Received: from esperanza ([176.120.239.149]) by smtp.gmail.com with ESMTPSA id j23sm1621386lfb.93.2019.06.18.13.02.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2019 13:02:54 -0700 (PDT) Date: Tue, 18 Jun 2019 23:02:51 +0300 From: Vladimir Davydov To: Andrew Morton Cc: Colin King , Michal Hocko , Mike Rapoport , Mel Gorman , Stephen Rothwell , Andrey Ryabinin , linux-mm@kvack.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: idle-page: fix oops because end_pfn is larger than max_pfn Message-ID: <20190618200251.hd2uk6qzyvsy55py@esperanza> References: <20190618124352.28307-1-colin.king@canonical.com> <20190618124502.7b9c32a00a54f0c618a12ca4@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618124502.7b9c32a00a54f0c618a12ca4@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 18, 2019 at 12:45:02PM -0700, Andrew Morton wrote: > On Tue, 18 Jun 2019 13:43:52 +0100 Colin King wrote: > > > From: Colin Ian King > > > > Currently the calcuation of end_pfn can round up the pfn number to > > more than the actual maximum number of pfns, causing an Oops. Fix > > this by ensuring end_pfn is never more than max_pfn. > > > > This can be easily triggered when on systems where the end_pfn gets > > rounded up to more than max_pfn using the idle-page stress-ng > > stress test: > > > > cc Vladimir. This seems rather obvious - I'm wondering if the code was > that way for some subtle reason? No subtle reason at all - just a bug. The patch looks good to me, Acked-by: Vladimir Davydov