Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7999457imu; Tue, 4 Dec 2018 00:55:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/Un0hv/ZYTRAfU7YAQ2+6c2ghXSLMS/w6tRWhAB0qzMO3g24efsaBbK3OTBQ+9ggEwGfbg2 X-Received: by 2002:a63:101:: with SMTP id 1mr16109307pgb.152.1543913713800; Tue, 04 Dec 2018 00:55:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543913713; cv=none; d=google.com; s=arc-20160816; b=MZi4PJLk/wqMcZ31fTdiLrStKPAK/WPmPSO0fBUD9+uW4LIcrlre4frUafoNHvZ3kx Ui+gJ9s+sLMlB0SjAy1tE+9/utwo5kKP5XfS30CUBGV73i/K5n/PZpS2eeOsi1qOv6Wk n87Srxp173+n+TnUeH0zu6wL0jOGjT18FyJTxThblycTnl1FnzCWu1bqH8rsPzuQsS4r FtfHyUjChPFAZTvGe88fwCg7DRg2cUZmUU3C/Nbn+NoT/b903MNLAngZ4o7GfCY4aZcm bGq8pTUdAjSATIMYReBDGMmk507ZF3cqch1L4kmRmPZQhjOCre/RVbo/xwdN/blDquBI HI8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=naPYivzUbSD136Zmc8GMw+uYeyRypkHMz0OobuffUDM=; b=Q2txj2M3rU7oYiV6qODL/+sVqogouChx+iQwqxJQltJxgTX4AW/NFgVyy79Al69e5v fT2Pezt/xvR4iZ4H0eoZvkjxx6tGCKvaEtB7tkpdD3C7Z00/Cw1sA+DceidSLgzeDIti uzE53yVw6wLMo59c+esWDwrBX13C+V2G5qz/YckX8yEHbh3yQ3xc72ntNFQjdcsj+fNl Xoayzw16VyITGJdqEaUKX16V9uydAtJWHtBhVT0+OYQj2+/iTp77p+YHtblvLAleOaM9 U1SmY72Lx0ItFiYZndkNOdj7HgUWHGFd47MxpySjrMuokYPeiSGhadxeCLHmhUQGEk2g brPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NlmS0Wyf; 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 z5si14661015pgj.177.2018.12.04.00.54.58; Tue, 04 Dec 2018 00:55:13 -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=@gmail.com header.s=20161025 header.b=NlmS0Wyf; 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 S1725887AbeLDIxH (ORCPT + 99 others); Tue, 4 Dec 2018 03:53:07 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:47007 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbeLDIxG (ORCPT ); Tue, 4 Dec 2018 03:53:06 -0500 Received: by mail-ed1-f65.google.com with SMTP id o10so13168938edt.13 for ; Tue, 04 Dec 2018 00:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=naPYivzUbSD136Zmc8GMw+uYeyRypkHMz0OobuffUDM=; b=NlmS0Wyfuo+XM4apPPYOa5PH00bfzaFF7+bGF+3cKKGYT3R3rm13Jf4McnZ+c9VUrU e4/j9jzsb1t0h6NvfGw7DjfpNYrDkKXa1LFMXC3yARnehuxjvWwoA2Lor4OwWW/GPCAh +eet768Nu7jPL7lh0ijEj3ZA+efpBG7AB9b37osQYHKaRJkW+T1fZEhJC7z4ZBqWEu3h NL5BGT0VrEEyq6sEtRzZBvxArPEuzCjE/9t4jWF8/oQFpjvegq6l2g71EXH26ovPNaUt XRTZtV3vHy6OBto2kN4BLCMQuwemnU7zh1GXQlfunZC8kgwnZ0WCHv0PZWM9I9aixmz0 SmzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=naPYivzUbSD136Zmc8GMw+uYeyRypkHMz0OobuffUDM=; b=bw/pkl2C/G15cFgz4z1IlfRz5CezU0Dhi9fqhjbg3Hfkjt17Sc+/UScrKlnh2cUR0Z x4mpBlg3AxHNYy2A/2CF6IHqHpxbJRI6IQthM+8npn865em7O5DFNw6KZ3rQ9q2CLUSf 3H8rJeiglV+sIjM6goHuKzaS9poeViauW5FI/bbggXUvOcER70xj/pr+y7tQYkSRY40o +7Ytj3HCa7swzIRlPZwcZPk/AF3Yf4RSYx+IhykqfZ2r/GxUQ3c9bpnZ9WJLc/D4bSxz NvHwfnT5LIFVXuqd+wlWcf4NNLs8deRy0GOOPmnMMAaZmSxHz3481UKzUTCS2rQoiGTM NmLA== X-Gm-Message-State: AA+aEWYKe8QHwk5WlcfkYkhGz6vrLS5Lx+gmlzYAAs79vl0H7hE/Ipn7 vVUKE3aoOMqNCM/TrN5PQRKjz+LwR/Yl9heGwQ== X-Received: by 2002:a17:906:3488:: with SMTP id g8-v6mr15311029ejb.11.1543913583728; Tue, 04 Dec 2018 00:53:03 -0800 (PST) MIME-Version: 1.0 References: <1543892757-4323-1-git-send-email-kernelfans@gmail.com> <20181204065453.4rsyhtsk2aej4vim@master> <20181204083428.emgcaomg6vulknaq@master> In-Reply-To: <20181204083428.emgcaomg6vulknaq@master> From: Pingfan Liu Date: Tue, 4 Dec 2018 16:52:52 +0800 Message-ID: Subject: Re: [PATCH] mm/alloc: fallback to first node if the wanted node offline To: richard.weiyang@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Vlastimil Babka , Mike Rapoport , Bjorn Helgaas , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 4, 2018 at 4:34 PM Wei Yang wrote: > > On Tue, Dec 04, 2018 at 03:20:13PM +0800, Pingfan Liu wrote: > >On Tue, Dec 4, 2018 at 2:54 PM Wei Yang wrote: > >> > >> On Tue, Dec 04, 2018 at 11:05:57AM +0800, Pingfan Liu wrote: > >> >During my test on some AMD machine, with kexec -l nr_cpus=x option, the > >> >kernel failed to bootup, because some node's data struct can not be allocated, > >> >e.g, on x86, initialized by init_cpu_to_node()->init_memory_less_node(). But > >> >device->numa_node info is used as preferred_nid param for > >> > >> could we fix the preferred_nid before passed to > >> __alloc_pages_nodemask()? > >> > >Yes, we can doit too, but what is the gain? > > node_zonelist() is used some places. If we are sure where the problem > is, it is not necessary to spread to other places. > > > > >> BTW, I don't catch the function call flow to this point. Would you mind > >> giving me some hint? > >> > >You can track the code along slab_alloc() ->...->__alloc_pages_nodemask() > > slab_alloc() pass NUMA_NO_NODE down, so I am lost in where the > preferred_nid is assigned. > You can follow: [ 5.773618] new_slab+0xa9/0x570 [ 5.773618] ___slab_alloc+0x375/0x540 [ 5.773618] ? pinctrl_bind_pins+0x2b/0x2a0 where static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) Thanks, Pingfan