Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6197636ybx; Mon, 11 Nov 2019 05:31:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw+YDqafqMB1aRMWYAtvhN+gEYnIEBrK0lx2jDwPPKED1Moun521c7/PECZHg/QjkecvQ8E X-Received: by 2002:a17:906:9481:: with SMTP id t1mr16089244ejx.0.1573479083998; Mon, 11 Nov 2019 05:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573479083; cv=none; d=google.com; s=arc-20160816; b=KHM+GsbbccEFBckPFpRL9bS9XYuX3XfWB9F+5lAI1Ck1sUVGbBMi+69Sl3MckCgmsc GJ8AaZvphAc458zj/e/Z5RAXrY4MidYD/rAw3gFqBFJJXlqgncnPss7b3e7jcsFE2NGQ gtBRHy85UQOILCTrOFDgV+8U7DJn1g1E/xSbjM6jmB3dSwig7Kvb7qWFKUpdrZIdr04m 3FXbK/zctGhrGoaLxWKf0nppFQZMTWNF5UkOURMQ683edHVQRSMHqUIwS+DnI0aM38za IneA3CBCgvEWr0QS+YZwioq24CI5wNytugD1Wmajx+jPPxqQ4xFbmWCqGKYi9SKwNak5 ltkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JB/FJV4eFVzQ6gPhioNfFj4E5oFAYhQtCUJZUz6oryo=; b=SQESUtOIed76d5RS6yFlsI6dQKd5t8tPJDssDzYKXEIpIZ7XQUCtrdCMBJlcm91Icq 95nm80sJou6m08EgV0KetaQeZWLo1f+dCaCCzWoIs26P62wnH4cYC3HfQ9y3gvqaxopJ 1ZlO8ct7Iuu3HCWf9Dw5MxsV/sJAwg3/AtL6bBliR9RWds/1kqZ+E19oHko7FA7S+7Pp /OgTrLEHB8YZ4TlEAgZKoJR/2w6WdrLnITrGA4xGdLaZVEwNoCcvv8s5kbqk6Tz+SeLw A7cCLBkpIrLa65KPxB9OtlMjuEo4XpNwM06enDb40qm4q2n1/hXGsnLc0yKWULKjvup5 8WgA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8si9365705ejj.328.2019.11.11.05.30.58; Mon, 11 Nov 2019 05:31:23 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbfKKN2P (ORCPT + 99 others); Mon, 11 Nov 2019 08:28:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:51762 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726910AbfKKN2P (ORCPT ); Mon, 11 Nov 2019 08:28:15 -0500 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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