Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp328530imm; Thu, 2 Aug 2018 20:15:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfuj9+1tb0DqMD5KvNrLRCGY3f7QvDty8K6HMrT4Lhyo9XVH0LP0hc8nmnMAwRUGunksYm6 X-Received: by 2002:a17:902:d710:: with SMTP id w16-v6mr1849266ply.93.1533266105182; Thu, 02 Aug 2018 20:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533266105; cv=none; d=google.com; s=arc-20160816; b=MNcFfQtVZAD1qa9spOPgR8FW4hXfJPBj6iKvqhrdkShjW63LFHHDdki4J45frU5WrM 2ZEOj0Vy+VaAVIWOfU/XbVCJb8+TNxSbvavajVDhSxCrfohXID9Claj7agfn6pQ77uxe FanXzrGw2MK9AIRgm72tXHIduV2A0u/FbqhA0hMloJQMbKbAMbqJzj9kC8GdqONZrCFH P+9LTj903wuRGwZdx6j09e39R7CUJbdHsOyqFL3z9evpFqHG0kgwlwiZ1IfaeoRgua8X oIJeCvPFX7vYUfcQ7J2La1RIqr+kZCfWvhsIGYle6lHVAhxZdaAxSz4WR84lrvXch2fz e9ig== 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=70UudvR4Nr/Y3/aiENOHEnQoVZyn9oliX37tLo50+Cg=; b=B84T/fi82F9ldwwoKdx3Tt/0AlFLcPGiUJ5RLlBagOtk9Acg/E338WkrkiyopRnMMc v0ejwqx3XhCGVYKiCwH8PRWkrIXgjMolpd+b+5v7lV6fYDqFxGHgd1vIP1fQWiumoqa/ Z9g/HsADAZTM8zb8GKQiBbSWQCBZZKm+KBjkpqGbffouWQR5k7bGQS8yCoy4Kh5ISL1C 6Jif/RKIwq8jqk6GYysJv23/onn46oDwc2KdaBJidAYCp26JhcFRqzcM8LpI8d1+azwL nKUBIDGTbyVcYSP1soaq1W+PmUv7k5T0K+K8D51XUrGfXT8Cts2l+afKQyeg2epcFHgd Di/g== 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 ca2-v6si3365909plb.305.2018.08.02.20.14.50; Thu, 02 Aug 2018 20:15:05 -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 S1727836AbeHCFII (ORCPT + 99 others); Fri, 3 Aug 2018 01:08:08 -0400 Received: from foss.arm.com ([217.140.101.70]:37022 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727521AbeHCFII (ORCPT ); Fri, 3 Aug 2018 01:08:08 -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 5AA4B15A2; Thu, 2 Aug 2018 20:13:58 -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 4CC8A3F5BA; Thu, 2 Aug 2018 20:13:57 -0700 (PDT) Subject: Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes To: Christopher Lameter Cc: linux-mm@kvack.org, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, mhocko@suse.com, 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> <01000164fb05bba7-1804e794-a08d-4ee0-b842-c44c89647716-000000@email.amazonses.com> From: Jeremy Linton Message-ID: Date: Thu, 2 Aug 2018 22:12:52 -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: <01000164fb05bba7-1804e794-a08d-4ee0-b842-c44c89647716-000000@email.amazonses.com> 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 09:23 AM, Christopher Lameter wrote: > On Wed, 1 Aug 2018, Jeremy Linton wrote: > >> diff --git a/mm/slub.c b/mm/slub.c >> index 51258eff4178..e03719bac1e2 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -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; >> } >> } >> > > Would it not be better to implement this check in the page allocator? > There is also the issue of how to fallback to the nearest node. Possibly? Falling back to the nearest node though, should be handled if memory-less nodes is enabled, which in the problematic case isn't. > > NUMA_NO_NODE should fallback to the current memory allocation policy but > it seems by inserting it here you would end up just with the default node > for the processor. I picked this spot (compared to 2/2) because a number of paths are funneling through here, and in this case it shouldn't be a very hot path.