From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B71CFC17441 for ; Mon, 11 Nov 2019 13:28:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 92A6821E6F for ; Mon, 11 Nov 2019 13:28:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92A6821E6F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 377FA6B0005; Mon, 11 Nov 2019 08:28:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3025D6B0006; Mon, 11 Nov 2019 08:28:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F0816B0007; Mon, 11 Nov 2019 08:28:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 089726B0005 for ; Mon, 11 Nov 2019 08:28:16 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id A11684845 for ; Mon, 11 Nov 2019 13:28:15 +0000 (UTC) X-FDA: 76144075350.26.hair82_82487d1d2c04b X-HE-Tag: hair82_82487d1d2c04b X-Filterd-Recvd-Size: 2067 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Nov 2019 13:28:15 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 52D3FAD00; Mon, 11 Nov 2019 13:28:13 +0000 (UTC) Date: Mon, 11 Nov 2019 14:28:12 +0100 From: Michal Hocko To: Chris Down Cc: Qian Cai , akpm@linux-foundation.org, hannes@cmpxchg.org, guro@fb.com, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm/vmscan: fix an undefined behavior for zone id Message-ID: <20191111132812.GK1396@dhcp22.suse.cz> References: <20191108204407.1435-1-cai@lca.pw> <64E60F6F-7582-427B-8DD5-EF97B1656F5A@lca.pw> <20191111130516.GA891635@chrisdown.name> <20191111131427.GB891635@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111131427.GB891635@chrisdown.name> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 11-11-19 13:14:27, Chris Down wrote: > Chris Down writes: > > Ah, I just saw this in my local checkout and thought it was from my > > changes, until I saw it's also on clean mmots checkout. Thanks for the > > fixup! > > Also, does this mean we should change callers that may pass through > zone_idx=MAX_NR_ZONES to become MAX_NR_ZONES-1 in a separate commit, then > remove this interim fixup? I'm worried otherwise we might paper over real > issues in future. Yes, removing this special casing is reasonable. I am not sure MAX_NR_ZONES - 1 is a better choice though. It is error prone and zone_idx is the highest zone we should consider and MAX_NR_ZONES - 1 be ZONE_DEVICE if it is configured. But ZONE_DEVICE is really standing outside of MM reclaim code AFAIK. It would be probably better to have MAX_LRU_ZONE (equal to MOVABLE) and use it instead. -- Michal Hocko SUSE Labs