Received: by 10.223.185.116 with SMTP id b49csp807149wrg; Fri, 16 Feb 2018 07:30:29 -0800 (PST) X-Google-Smtp-Source: AH8x224q7aB7/5yBx+AjvheRcrhRROhysQCdZYGzdhltrKXSFzXzmTRH6e+hUybfxVyK0wPCSQr1 X-Received: by 2002:a17:902:aa95:: with SMTP id d21-v6mr6278382plr.16.1518795028954; Fri, 16 Feb 2018 07:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518795028; cv=none; d=google.com; s=arc-20160816; b=da7gbQBUx0OGd2mdk90VEEKQDn8EvhuAEKsb0wYRFQcVEQGaBxKlsQDFeC1IsuEU4f xcsM+hsJN9Jle06ePYBU6BuHAmudhs0j6TF552zvICfco0i6QM4zANWWf/bu6fHrGsAA K2Y26jH0bMjQ9jp7alYf6evCV75RbMDrMVbjjss3pi3A/QAOG7+tZvOlfUgWJalACF/F oDsoirHXQ2zqsosCsaunoWBrAzhu/H/zENzfp/yoyk3Dg8YXHMLsxx3JwnzxjvrmCpsj sb9oxDWfhm/NKE+EhH7ED/diwigre6rW2NeyWmd5yYXxCXksnHCVquFchLPZmHnYdVNb u/fg== 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:dkim-signature:arc-authentication-results; bh=ZpJgViEgP3iyzyriCXG9EH+O+ap799NHyaMSl1JQVzA=; b=FP+XGVEZGZ3o6t9WkFg+nJ9FSbpXAoM97HBUx1IPIl9ZTs+ormQPcOqty/RxbVFVsO 4c82bD6cGFPXlfgX4qOYLkNEw29sgMekxvPfj8DoQnVhWD5ynFns5ggV5Ue2pi1gQWGT 2jLNql5LQeLNiqm2V09IJpXElRC2xIeIED3somyN9L9tdP3n9JYEau9rJzrSbj63Q3bL 4GkA3hauoXk2b7PKekZMGyxY9nb+NzhUKoNtB59B+P+bww1Q8QAaSXcz3Brk+Mr34e7M CCtHzouEq6r0Z0RzcEzZYn9W48nWj3WukzhTyhQvjGspt5cJTpbBakBpeqkQIEGEE4dC 9Oeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JsvTVeEh; 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 u68si1470519pgb.287.2018.02.16.07.30.13; Fri, 16 Feb 2018 07:30:28 -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=fail header.i=@gmail.com header.s=20161025 header.b=JsvTVeEh; 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 S1163761AbeBOVjV (ORCPT + 99 others); Thu, 15 Feb 2018 16:39:21 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:44498 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162541AbeBOVjS (ORCPT ); Thu, 15 Feb 2018 16:39:18 -0500 Received: by mail-qt0-f195.google.com with SMTP id f18so1492903qth.11 for ; Thu, 15 Feb 2018 13:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZpJgViEgP3iyzyriCXG9EH+O+ap799NHyaMSl1JQVzA=; b=JsvTVeEhpuian5GB3cpyLijJXJhn3+Dx+9VEvMdqiDZs1tZA+zLImW4Fhu6b/VHVzM TCn3cznxPQMdnjCMbrVNeQTnOBs55u9dqPWrorgd4QW6eTjndhK0IZfcFrANX7KjvU43 b4zchOpFEmwlmcdjxZp2Chm2+38CELNE3qkm744KEhNCPGXqqNgWc6lUgR6mAUs6uoap kd1/5Q01yjzl4Ut7xFoo8o72wMDDM9FVDs8NkB3eXVT/2PPQ6HtVgIV0on4V4rd86vB+ CXFfjYpmtPILf+RQAKUmvfniZpHX2vs5L+uVv3zMJUA3knXgUzCmievAQCiIpDP7jJ59 gVwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ZpJgViEgP3iyzyriCXG9EH+O+ap799NHyaMSl1JQVzA=; b=qHAiAzg9dq4tHbtyfh8bZLQIS+tR4SgOUNwSP2IZMqOZpJNvWKyNjLe/T07ssBa3A3 sl/JStsh7a9B3M8CpS+4PFSta2TDOcumv2EeF5GEkLU6HGthKkIrJ2Kprls+J4DZ4DKh 9sOJ/2rwx2MrZczteAPoqT21v/KEUHh3jVzv0iE0oQECHlx0ovnhtNk3adsvraGSU1Dz UFfWkC44Lx8WZlyFMbUczH5AfQHQwOLdemI5a0jnWtxNC2WQ/O3ledH6Dx87p4d2aOjV bPljJPHMGF62/mgm2ETvWA4gp35A9R80IQIW7NRROJtYroGTLLv6HrWqndG6GquFI/O7 hixA== X-Gm-Message-State: APf1xPCDvoh84I3Ro0zMXLBvP0Bwd7etWIec7DPStkVU2EoPhd2+s4m7 xjW9zEc99VHlErRQZRuf9Uc= X-Received: by 10.200.9.86 with SMTP id z22mr6591610qth.87.1518730757299; Thu, 15 Feb 2018 13:39:17 -0800 (PST) Received: from localhost (dhcp-ec-8-6b-ed-7a-cf.cpe.echoes.net. [72.28.5.223]) by smtp.gmail.com with ESMTPSA id c4sm10934489qtj.97.2018.02.15.13.39.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 13:39:16 -0800 (PST) Date: Thu, 15 Feb 2018 13:39:09 -0800 From: Tejun Heo To: Dennis Zhou Cc: Christoph Lameter , Daniel Borkmann , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] percpu: add __GFP_NORETRY semantics to the percpu balancing path Message-ID: <20180215213909.GU695913@devbig577.frc2.facebook.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Feb 15, 2018 at 10:08:15AM -0600, Dennis Zhou wrote: > -static struct pcpu_chunk *pcpu_create_chunk(void) > +static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) > { > const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; > struct pcpu_chunk *chunk; > struct page *pages; > int i; > > - chunk = pcpu_alloc_chunk(); > + chunk = pcpu_alloc_chunk(gfp); > if (!chunk) > return NULL; > > - pages = alloc_pages(GFP_KERNEL, order_base_2(nr_pages)); > + pages = alloc_pages(gfp | GFP_KERNEL, order_base_2(nr_pages)); Is there a reason to set GFP_KERNEL in this function? I'd prefer pushing this to the callers. > diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c > index 9158e5a..ea9906a 100644 > --- a/mm/percpu-vm.c > +++ b/mm/percpu-vm.c > @@ -37,7 +37,7 @@ static struct page **pcpu_get_pages(void) > lockdep_assert_held(&pcpu_alloc_mutex); > > if (!pages) > - pages = pcpu_mem_zalloc(pages_size); > + pages = pcpu_mem_zalloc(pages_size, 0); ^^^^ because this is confusing > static int pcpu_alloc_pages(struct pcpu_chunk *chunk, > - struct page **pages, int page_start, int page_end) > + struct page **pages, int page_start, int page_end, > + gfp_t gfp) > { > - const gfp_t gfp = GFP_KERNEL | __GFP_HIGHMEM; > unsigned int cpu, tcpu; > int i; > > + gfp |= GFP_KERNEL | __GFP_HIGHMEM; ^^ double space So, setting __GFP_HIGHMEM unconditionally here makes sense because it's indicating the types of pages we can use (we also accept high pages); however, I'm not sure GFP_KERNEL makes sense. That's about "how to allocate" and looks like it should be left to the caller. Thanks. -- tejun