Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9105032imu; Tue, 4 Dec 2018 21:52:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWYbizoEXsgO0rQV6TIcMIZwFA1wCxAaqAP+oHuQ/3qBnHkTw1meQGNHTQCWlsTqk3SGPk X-Received: by 2002:a65:520a:: with SMTP id o10mr19952568pgp.276.1543989131962; Tue, 04 Dec 2018 21:52:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543989131; cv=none; d=google.com; s=arc-20160816; b=h8IdqGhgK+6O6XkA+SPOd2qclX5+wiVEpkMjApXslV7znCPG4diCeIHeLVWaVIvROS pzXYlbwg9lVDkYTeJQtoJ1VxanqPWfoNvo2+W7XtF1XYVE3W3Kw4fIuvcUSzGI7wHDyg Bwpj5zPwbi2DgtsSn5Fd43dCXgV96lFAVfwwNOuisaJRHNazGHCbOdJJQ7PeJH/9CW2C IfLhcgCWYpyuGWpf/+i/6f10eHhOJmgmIS7feAjJB7aR/bQkBq7nxavWI6QGWBx7STdg 3d7yUMP8lLUU1BkQrfNWLuzOAAKdi3TSy3rDMlD66G6WjpZma2WAFb2MAuBNWo++ChXB FFRg== 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=NrqlGatGK9YWYP95JatWcvRkypUfQHeO7cDiS5LHNcA=; b=cRIoOJ6TY43bLcMvV4RmUJ7AuD63j9AgsMURJ5wIOrqjiVz4UAjOOXHEBmZ60eQbCB N7bndOiUyonz3p8ObxRzLRh8ALb/7k/+IReJNuAL0UNIuhAk6DlcqAG5GC+wAaEDzgcu fxicqfbJ2VBmT2Mx8GHBpljLodtaqBtA03Bs6LCup523ZOTg9qM+xwD1DWWjzfYJkYG1 pR40SJtLShCILrvXrLY/nSt9vbkqQuCArU7YI+rhpMuUPSquPUsXCy7tvmj74nmvnP/r jnQ3iSK7ZEPT5e3AUWDMiZXDxYebxntaPSIdnz7j71l/WDy1TPNJ5houxyWYAfBAA9uW XMIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BBi8dKY1; 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 s123si19820732pfb.274.2018.12.04.21.51.57; Tue, 04 Dec 2018 21:52:11 -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=BBi8dKY1; 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 S1727088AbeLEFtr (ORCPT + 99 others); Wed, 5 Dec 2018 00:49:47 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:36302 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbeLEFtr (ORCPT ); Wed, 5 Dec 2018 00:49:47 -0500 Received: by mail-ed1-f68.google.com with SMTP id f23so15973330edb.3 for ; Tue, 04 Dec 2018 21:49:46 -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=NrqlGatGK9YWYP95JatWcvRkypUfQHeO7cDiS5LHNcA=; b=BBi8dKY1MWqPViUyXV5LIuj9009UFj/amW5TyTPI2g8olZFi6gw5Jp2sxS8pJOCtUy dCptci7fWhyaFvDW0lRQeIzgpTvYen2HIyTlyYlPwXUSzg5CW1SMvXe4kGhy4tvGrFoi t40FTXiplCSytp8qRDxSWOFSJ4l9gwNSZ6gcwl+qyo7Et3Di+IUdkvsgkNf718HKP6Wc NB+Nyag9cSxXfutfRqol4N7o62vOyEedrv8gdX6YHsPWsxhZAakbQBz26dD3K0eh7nra jSVDh+i+25ytu3hdGN2xiWucGxz9qEUv3ZE4Bllwq7E/KWHTzLO7nqj7y7PfRBtaT1ii oC0w== 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=NrqlGatGK9YWYP95JatWcvRkypUfQHeO7cDiS5LHNcA=; b=k3I0zi+fUcdY/JnVHdxdUg0W/j5aaxyfoH332LxpHNyVhiiJAc3Nk0PprQ7/uVXbM3 Ke8iSwgQQTV0CU5GeDKvMM/uEowm81JBilyQl2MWkD8rYdgNuRS1sXLOVSCR/EAEJtg9 CrnfjbGfeFGELOnb1Us0Mx5peyZ3Tl0TndYdYYzGG9JbtI0UF8G/+qoTygbURGcgm5nf AgmZKVh1t1wK/rKUnXGMlsCd5lJGRcYNVaj8r3w+BnO6D33s70/B1csmHB/EahquvxIk VF5gBJjPr2RBatM20CVtvt1qw5BuIlSJITUZfxIyyZQHABEZp1JekujVCmG568VphkSW nYhw== X-Gm-Message-State: AA+aEWYdH9Mwujb53EUW+58lhmXoy6MtlgdnoWTmT0pjXxgB5VoTdJzy 9x6ywxkupN0by49aw5s2j/+KQo/Ysetj8RqCcg== X-Received: by 2002:aa7:cf88:: with SMTP id z8mr20563201edx.208.1543988985509; Tue, 04 Dec 2018 21:49:45 -0800 (PST) MIME-Version: 1.0 References: <1543892757-4323-1-git-send-email-kernelfans@gmail.com> In-Reply-To: From: Pingfan Liu Date: Wed, 5 Dec 2018 13:49:34 +0800 Message-ID: Subject: Re: [PATCH] mm/alloc: fallback to first node if the wanted node offline To: David Rientjes 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 3:16 PM Pingfan Liu wrote: > > On Tue, Dec 4, 2018 at 11:53 AM David Rientjes wrote: > > > > On Tue, 4 Dec 2018, Pingfan Liu wrote: > > > > > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > > > index 76f8db0..8324953 100644 > > > --- a/include/linux/gfp.h > > > +++ b/include/linux/gfp.h > > > @@ -453,6 +453,8 @@ static inline int gfp_zonelist(gfp_t flags) > > > */ > > > static inline struct zonelist *node_zonelist(int nid, gfp_t flags) > > > { > > > + if (unlikely(!node_online(nid))) > > > + nid = first_online_node; > > > return NODE_DATA(nid)->node_zonelists + gfp_zonelist(flags); > > > } > > > > > > > So we're passing the node id from dev_to_node() to kmalloc which > > interprets that as the preferred node and then does node_zonelist() to > > find the zonelist at allocation time. > > > > What happens if we fix this in alloc_dr()? Does anything else cause > > problems? > > > I think it is better to fix it mm, since it can protect any new > similar bug in future. While fixing in alloc_dr() just work at present > > > And rather than using first_online_node, would next_online_node() work? > > > What is the gain? Is it for memory pressure on node0? > Maybe I got your point now. Do you try to give a cheap assumption on nearest neigh of this node? Thanks, Pingfan