Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp81153imm; Thu, 2 Aug 2018 23:22:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4XJudxKuq5ikOfi9MgObmZYZFmcF8VP68g3hNN2XDHP+gOgDImM7ffLs9yfsw0JP4eBRk X-Received: by 2002:a63:cc04:: with SMTP id x4-v6mr2327743pgf.33.1533277361739; Thu, 02 Aug 2018 23:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533277361; cv=none; d=google.com; s=arc-20160816; b=Z67MZ0ommUpWYO+gW0IPZWioIfLe6gISJJyBCNpDq/DaWNTEEGke5G98UByeiQYyW5 GIomA1t7ncGtm/bM8HJkbKa5O/739gimbY2TYHsUtwOyRKPgHzuKGQWRICskM78tmH2+ EFboGpshK3fW6fPLRC+x5XBbVgKmnMIVb6y2xdrCQakpr0pPa5knU5dRMJvrO3qYuOIC eW0k0IaGh5I+IMhR4hg9E5yDpjmM42ZUpOJEaXfv3aihxb1ajxBNkdG8O17Tb3Gz4M0R IZvHEdFNwbiVFCnT3CWEHgFKeIx8/sL596/qlzuSrAI82+zFcZvjOUvnZZh/9rVgTZza EgFA== 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:arc-authentication-results; bh=r6vFIJDDUzvOCcfWOfdyMeLeuVaN8dNpzhY2Gi1wXs8=; b=bb60Ad5L4RtGR3UzWZzTTbnaKPYhcAmHxW5+wZEDRiWlgmTTl9p4UvzYUj3Jf3F25e WsxgQqKZDOZXj3aOwY223Cpn75DF9p0EW+QbwAJw5FbRUlVDkGpIDRHQHncC+XaGse8y E1S1MbLCZ/28LNXGmbxGeKrn7qKhe5lTx/ebvLaBMwKYUJLQt2e0p7qvM4SFoSh7Vteu qcPe2KBW1pq2EAdJQ805+Y4rFAvEP8jJ58ElVWWcnw3wwvOZ8umIUMo8xrliBwFCuF85 46xMd1nAipvUHcnEfGOygrvuUl5JGQoY+8y+v/jFFDSuKtHteQKeyXLmgblbgpsoXRs4 8pNA== 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 x19-v6si3921930pgl.660.2018.08.02.23.22.27; Thu, 02 Aug 2018 23:22:41 -0700 (PDT) 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 S1728158AbeHCIOy (ORCPT + 99 others); Fri, 3 Aug 2018 04:14:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:54384 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727250AbeHCIOy (ORCPT ); Fri, 3 Aug 2018 04:14:54 -0400 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 4D078AFCB; Fri, 3 Aug 2018 06:20:10 +0000 (UTC) Date: Fri, 3 Aug 2018 08:20:08 +0200 From: Michal Hocko To: Jeremy Linton Cc: linux-mm@kvack.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, Punit.Agrawal@arm.com, Lorenzo.Pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, bhelgaas@google.com, linux-kernel@vger.kernel.org Subject: Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes Message-ID: <20180803062008.GD27245@dhcp22.suse.cz> References: <20180801200418.1325826-1-jeremy.linton@arm.com> <20180801200418.1325826-2-jeremy.linton@arm.com> <20180802091554.GE10808@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 02-08-18 22:21:53, Jeremy Linton wrote: > Hi, > > On 08/02/2018 04:15 AM, Michal Hocko wrote: > > On Wed 01-08-18 15:04:17, Jeremy Linton wrote: > > [...] > > > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, > > > if (unlikely(!node_match(page, searchnode))) { > > > stat(s, ALLOC_NODE_MISMATCH); > > > deactivate_slab(s, page, c->freelist, c); > > > + if (!node_online(searchnode)) > > > + node = NUMA_NO_NODE; > > > goto new_slab; > > > > This is inherently racy. Numa node can get offline at any point after > > you check it here. Making it race free would involve some sort of > > locking and I am not really convinced this is a good idea. > > I spent some time looking/thinking about this, and i'm pretty sure its not > creating any new problems. But OTOH, I think the node_online() check is > probably a bit misleading as what we really want to assure is that > node so we don't deference null. Exactly. And we do rely that the user of the allocator doesn't really use bogus parameters. This is not a function to be used for untrusted or unsanitized inputs. -- Michal Hocko SUSE Labs