Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3065449ybx; Fri, 8 Nov 2019 13:30:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzfLOUnkN087q2f0ccQ0q6kY9b1O9UYoKhfO0FTt1Hplm7wHZHWqxzp1ffxC4YeaYZok3cv X-Received: by 2002:a50:fe96:: with SMTP id d22mr12906147edt.227.1573248649909; Fri, 08 Nov 2019 13:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573248649; cv=none; d=google.com; s=arc-20160816; b=zB3jHNCK6gs1RWrHseaTk7stU3qGvxQ9J7JG3puQICp/s4sXRIake9w3/I+5RxqZ+P urPzsFFMmNkXdv3InkCdNXZnhterJYPT136zJy/fq/Zqv2QebGCV0iXrq2knR84opy3p C3QjGZnbwBWP6b5e3Q8iuFLLslvzFGZ56H+21LJoFmjfGJVniyELZpwEQ3Kj84PXU0El 7T4FS3uYPa0z8WrJ2lANsFuwukhkSsxDt7HmBOg7YxvlHGLizcHpLbsigEJSvXlimpzZ gpywGtCbNjX+xmxU48WC7f0UoSmf19md4p7OgWXi2XoPxuuqvoXsOKZHM0nWPOkcrvRk UMZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=E/re/TtVqjhhFyMNUDrEMQoMA+rNSBWgaDnjt6xblfc=; b=eQb8vXJejshlAz8eP5zcLUUtWBVJbYmCkfajG+P/cI1fFLobEOtyZANw+ymHIECGXj SG6MTbjSzTMoejw3C/liGyGT6W42rL6eF07FlXOBz/Q5DE7Dkfe9PvTdHOrMGoXiOYLu Gk0WLr28b0nBGlU1dnRdfJProtpUhC13zIjALe9l8PjJXDZVmeUnkRiqE/3MeRghQcem s2wumDwvWh1SE/Ka6ZxAXqH7k5gNydA7Mke4ljZrvu6KIkTTbvFHfQgNJg0sc0ebk5So pGDmJKzbo5SPMCOmrLH8waYRzZJZIyOcF2L+7qz9LVQLFEIRjARCnYrbYH4CKOxVjly3 L1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=BGsscPnI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e50si5223157ede.59.2019.11.08.13.30.25; Fri, 08 Nov 2019 13:30:49 -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; dkim=pass header.i=@lca.pw header.s=google header.b=BGsscPnI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387421AbfKHV06 (ORCPT + 99 others); Fri, 8 Nov 2019 16:26:58 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:44837 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387395AbfKHV05 (ORCPT ); Fri, 8 Nov 2019 16:26:57 -0500 Received: by mail-qk1-f177.google.com with SMTP id m16so6567843qki.11 for ; Fri, 08 Nov 2019 13:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=E/re/TtVqjhhFyMNUDrEMQoMA+rNSBWgaDnjt6xblfc=; b=BGsscPnI0I/AhxQtkp1ur0VrFYXf5H8Fg7QmP8nllWAk3LB+1xRvuro/YNq+Wi4p5F 3ZAD5u8+aHKV6BCRpJFppf3VuxZKf/sv7n021xyePsMo0qyk4ioIipKyJxsfny2R6RX3 muOR0J1B2kxQSzV9581+eZYOESV3d8dZz1I/0lFZM3rKt3ovoGT+VSWRIahQ6OsN3IV1 s8FtMLqcLzCVTjdBygGBm4m5G43Y6e3kQ7cTLWjekKCGP5ylAKVgqVGK8DUT21Ht4cN8 7GXkMXTsKy8U08dIiAi7+G9AKRSNl22O/wb8ep0nz17TwjAIvaYLFkN2KBK6QMSY1A7d ming== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=E/re/TtVqjhhFyMNUDrEMQoMA+rNSBWgaDnjt6xblfc=; b=S/6tTGdmBHkEx0/Wfqpwnr3Yc5VfKRdwTdJ8dVItdOtlsEi/eLKHL4vAfdKmDqFd3z xJLUVKbN3dJSN8WhZBRJvgWW1FnndF2Zdqu/EjwuELCO+JaQM5Tko+n64dv0HOlujudz oMLR9/pS4fMrTaDYEuVqgyGAH7c9k3sVh9gHlNCicc+1tbms5/WDlwjjzbk47hiD3Q2X etIVRCPR0fyXpgDltoTjujpqg7/FnPlE9Ur+iNHmVGA6n4VZ73tdirir5jwoSaUFSbK/ m2bWa1ypQwBwSek5A5kXkXHz4wNA173uNugAG3rpvjFaHDu8MFt6UfSXXGJ5M4LQzAOR 2AzQ== X-Gm-Message-State: APjAAAUdNYJJ22AxNLdlJcXBMWqJtX9fRK5SR1IPLOlBtPoWIAUncajd tORpL9pF4sSINz76TX9Ft/3N6AXW8H+MNw== X-Received: by 2002:a37:9d86:: with SMTP id g128mr11128288qke.191.1573248415230; Fri, 08 Nov 2019 13:26:55 -0800 (PST) Received: from ?IPv6:2600:1000:b04c:9cbe:6d67:a89d:e323:d2c? ([2600:1000:b04c:9cbe:6d67:a89d:e323:d2c]) by smtp.gmail.com with ESMTPSA id o2sm3375987qte.79.2019.11.08.13.26.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 13:26:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH -next] mm/vmscan: fix an undefined behavior for zone id Date: Fri, 8 Nov 2019 16:26:52 -0500 Message-Id: <64E60F6F-7582-427B-8DD5-EF97B1656F5A@lca.pw> References: <20191108204407.1435-1-cai@lca.pw> Cc: mhocko@suse.com, hannes@cmpxchg.org, guro@fb.com, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20191108204407.1435-1-cai@lca.pw> To: akpm@linux-foundation.org X-Mailer: iPhone Mail (17A878) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 8, 2019, at 3:44 PM, Qian Cai wrote: > > - for (zid = 0; zid <= zone_idx; zid++) { > + for (zid = 0; zid < zone_idx; zid++) { > struct zone *zone = Oops, I think here needs to be, for (zid = 0; zid <= zone_idx && zid < MAX_NR_ZONES; zid++) { to deal with this MAX_NR_ZONES special case.