Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp333647imm; Thu, 2 Aug 2018 20:22:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/nmuWc+suhtw+JDPAzOe6BNxU4x4pchGYXr5RGy6r1u3lrCkI7QhSSbC+tBZw5XAEReH4 X-Received: by 2002:a17:902:8482:: with SMTP id c2-v6mr1871091plo.45.1533266579164; Thu, 02 Aug 2018 20:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533266579; cv=none; d=google.com; s=arc-20160816; b=MWx0Uako9XlRrsol89W/v27eXdtpl6YZBg28b66Hl/X5i/G2a8Pzzc6suqvXhP7LST G+ADTC7tThQJlUdQ1aRPaRwizDi8crlFxOdpUovFS3Rem4fXjBDb9RtMB6GmGfaLoIum zL7Zv6Q3ekiTDV60Em/9fXYbOgbefHV7Ied7f8NRntFaFdXsYK+OvaBtCa5SG3r1N3FF ZY8KjDfQJ/K9b3gk+oo+Q7WUmYSRQFaLbRX6zRjr6KUyiUvnD5f2LnhvVf7qaI+fl7gO ylP3xcqj9CwrcooxJYQVvuc75xAkwJeE473sJmVjztnoZ2lSE860rxGykMTMO8WSrB1Z SrdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=P8oduCg7SubjJdoQZD3Xz/khm+8DlEFzAB6XP8fO6B8=; b=za0GZZPQ4whhXAnZ9i3XYAaN4STJ7Ac7HuKRzAvZBDMVN7ChYI76fDckPIX0BCcpBY DjI15ROh8H33ZIg+maz+PRu6h3uRBRZPqwnRVMSg0xmJ+ccs1gX3qGOD/MonnePpa1LO Bf3GqglqlT+dHQZtaiqS+/69zSq9fwaTRc40vkjj2oZ5ujCf0fIxVz2UgKrLcJQYhg/q LTpB8NHazC1UnA0Yc5OXXDrGHf5MKwjojCP9hvGlEE3TjbNARK/R21Mk3eZHf9NLSa7+ 4JGxeY1RXQJxuHUS3seI1ogvG4zb6WzSKQylZ7/hDqYuzh6LHfrRCHgKK9vp+B79eb79 dh0A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s71-v6si4063569pfa.367.2018.08.02.20.22.44; Thu, 02 Aug 2018 20:22:59 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbeHCFQJ (ORCPT + 99 others); Fri, 3 Aug 2018 01:16:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37282 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbeHCFQJ (ORCPT ); Fri, 3 Aug 2018 01:16:09 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B0D418A; Thu, 2 Aug 2018 20:21:55 -0700 (PDT) Received: from [192.168.100.241] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AE163F5BA; Thu, 2 Aug 2018 20:21:54 -0700 (PDT) Subject: Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes To: Michal Hocko 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 References: <20180801200418.1325826-1-jeremy.linton@arm.com> <20180801200418.1325826-2-jeremy.linton@arm.com> <20180802091554.GE10808@dhcp22.suse.cz> From: Jeremy Linton Message-ID: Date: Thu, 2 Aug 2018 22:21:53 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180802091554.GE10808@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> } >> } >> -- >> 2.14.3 >> >