Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4216118pxv; Tue, 29 Jun 2021 01:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIe95n7f+fmZZP0uIeTszVny2/uH+l81RZ+FWT54VYOoH1XjTwnKr2W4pHtvMslNfYxPHg X-Received: by 2002:a92:1948:: with SMTP id e8mr20741196ilm.77.1624955678617; Tue, 29 Jun 2021 01:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624955678; cv=none; d=google.com; s=arc-20160816; b=PZOiCRZ/h7Ox6gdEe3NUIghme7jL6Ov6nyA/v7kyGxJga/hVxK9tnbBV9WZ/xeWigG H23N3FxmpcNxFJCrPHCX21L+/ylu5v1EUJopKCOceKqWfwnNBRb12XU+2tPrFUsooOKT EmHCgb8uRq3Mz56dXV9ADQrU4m4IDC0cldcx9FoqDi25rzJwpi7gSehlni22/LbrBLsX XGB6CsSut0CpGDNAUqaF0hqgAt2xXQKBfzZ92gW+ok3QbCsa14Eyiwiw/iPmhzCKZlSV mCYD2h2vWwzqkWjZe+W+NCvu6SvBXGehRGUPjxpDn0ERjTtLB8oyuyocVBzPS97f+TmD JCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8i5UiIsk/86sr+7otL2SfZqb/4mI1CjxuQjrZBxPa1c=; b=oX/EWWNJROX9iUyR7TBinVTLOcAzNxn3+Gc66cnDUjCN/yAtLqW5EoRmGjHvblx2+6 Oqmj6RserP550gFfL2qCGVzJwfCU+Mk7EnpOmh92Gk6YXEleS4ZrUL4+cPav1fSMnaIN v9Qpn1u6+qMOeyaCgp1VxjaphplsiXqtuVExaorPJEuOvTgXWc/8t2DZyUB2GTWvbH26 f3cQmKKHbqj+5wpaioBmaD3YKvuP3BM3dyY/z6pK3JuLY0Gsq1p3qnXZGCUeJh12PqNq LxxD+IQb+MT2gXjkNbXdDS8nkTa99TzhZbiiSEyl13cPMoyGAbNLDV4rxtpgg/e5WBWp Tb4w== ARC-Authentication-Results: i=1; mx.google.com; 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 f17si18503521ilj.76.2021.06.29.01.34.26; Tue, 29 Jun 2021 01:34:38 -0700 (PDT) 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; 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 S232533AbhF2IgF (ORCPT + 99 others); Tue, 29 Jun 2021 04:36:05 -0400 Received: from elvis.franken.de ([193.175.24.41]:57434 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232479AbhF2IgD (ORCPT ); Tue, 29 Jun 2021 04:36:03 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1ly9BU-0004qC-01; Tue, 29 Jun 2021 10:33:32 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 84EDAC073D; Tue, 29 Jun 2021 10:32:23 +0200 (CEST) Date: Tue, 29 Jun 2021 10:32:23 +0200 From: Thomas Bogendoerfer To: zhanglianjie Cc: jiaxun.yang@flygoat.com, chenhuacai@kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm: Fix the problem of mips architecture Oops Message-ID: <20210629083223.GB4650@alpha.franken.de> References: <20210628091105.27641-1-zhanglianjie@uniontech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210628091105.27641-1-zhanglianjie@uniontech.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 05:11:05PM +0800, zhanglianjie wrote: > The cause of the problem is as follows: > 1. when cat /sys/devices/system/memory/memory0/valid_zones, > test_pages_in_a_zone() will be called. > 2. test_pages_in_a_zone() finds the zone according to stat_pfn = 0. > The smallest pfn of the numa node in the mips architecture is 128, > and the page corresponding to the previous 0~127 pfn is not > initialized (page->flags is 0xFFFFFFFF) > 3. The nid and zonenum obtained using page_zone(pfn_to_page(0)) are out > of bounds in the corresponding array, > &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)], > access to the out-of-bounds zone member variables appear abnormal, > resulting in Oops. > Therefore, it is necessary to keep the page between 0 and the minimum > pfn to prevent Oops from appearing. > > Signed-off-by: zhanglianjie > --- > arch/mips/loongson64/numa.c | 3 +++ > 1 file changed, 3 insertions(+) applied to mips-next (with subject changed to reflect what patch does). Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]