Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4573847imc; Mon, 25 Feb 2019 07:17:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IYS6LlvuYw8xyL/wKMfBOCYuZ/pLa2GCyRq0IQDLmQTNLRddu/dUGYd2eASijjS5BjdElUh X-Received: by 2002:a63:1060:: with SMTP id 32mr15374554pgq.126.1551107822124; Mon, 25 Feb 2019 07:17:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551107822; cv=none; d=google.com; s=arc-20160816; b=Oo2Ks/6Rm36Vu0Aoxq9jLz9IgMQp0i6V/OOnhNks15enkNcx+nhbe6Pkh28jS1IEQn tmucMQ2LBlHdLc0SfQUiqFcxD+yI59Ug8reZZI5AFz1PvfsMSTVM9k8gaIJQ5J6VgJPd IMym07Tbu+Dd8tlH/9eKRnS83OJxc9++lfQpgJ2eS289yRS/28sB25ZzeZnLRj8EvIk8 ym7tyO6A+V5vTr5uEQ4sVWM0e//f/L9F3+I8lXu3d6Fo6Uw/VFdCoKC6jZKgS0Tv1I/e A6kMCYDGy6tiqV9UuhXSbqCUajtq8sPObcZTOzFsNhW8UFncYtADpJyGAqjRXwtiBSED dAyA== 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; bh=SukbM8CMAxoSkIyo1H69YojjlibI/3WJVBKhZOY9v1E=; b=ykRqcET00g4t3pryPkAtx85Oy3TEapl/OkkcyPXAXoig+HnP5f+UZX0HYNIBikZT+g V6+fFS7r9ygn4k4YKhOpBsAfjJPtSz3X0w0E61i5TKWWycpL2xDwPEk1QV8cxbdIujf4 7yyXa8Gt0PZxS8mGW/WOdvYPnvl4CHja/N/Xg2+2RXqy9Dk4pRxnaX9IzU0uSemAAAAP 6yHilI2nQMJTH/9zXzedCrbVF/lDOtOSVSp2gMWoU2vXTFhEmPZgTPSk+3QYiRNlDDtc FhTRZlwHafe8f/L9z4Zx3fJDrD2jMJ4EbMsiyPXrpPXatgE2MkaKqubmpV61NcZgQgUl WcLA== 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 u31si10223166pgm.352.2019.02.25.07.16.46; Mon, 25 Feb 2019 07:17:02 -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; 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 S1727529AbfBYPQU (ORCPT + 99 others); Mon, 25 Feb 2019 10:16:20 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:44452 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfBYPQU (ORCPT ); Mon, 25 Feb 2019 10:16:20 -0500 Received: by mail-yb1-f193.google.com with SMTP id c3so1554295ybo.11 for ; Mon, 25 Feb 2019 07:16:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SukbM8CMAxoSkIyo1H69YojjlibI/3WJVBKhZOY9v1E=; b=snu2dam0ZzYO71OMCuG6TWk6oFqxMpLUUOg3qSljziT5U3mpeYuFkQYqWUDXGvqYt3 s9cuORAUa+SShqsVTKhtFv7lGDrrw706ZU9dbA62BLnkwcwsVjnk3vJPCxfwOez8G+hA lnORYXNg/lDhTw3qtM0yEsWWaC7vygC8k+gZEuY/bxCMlSjmUhEgQQHxyOxhYlr/N9EB xcM2vpf4lM/IRoxhc8Wh4U1BLq2zaT+TeMzNETzZfSaSx/J/VKRiPIx5a3+a9DFBjA7j CCVL2IVlBFiMIwCCryUKyKeJQkd3A6sIJusJabKcKxLB0h3Q8scS4HmJHkTYest/H28N oFQg== X-Gm-Message-State: AHQUAuaNHkcnFvBSN5trth5sMIy4xgH7ViMZZ21inWMi3X2NmoXN525H a8xuqVxr/w7WwBwRmJalquY= X-Received: by 2002:a25:23ce:: with SMTP id j197mr6003459ybj.145.1551107779237; Mon, 25 Feb 2019 07:16:19 -0800 (PST) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::1:8bb9]) by smtp.gmail.com with ESMTPSA id d138sm1986291ywa.43.2019.02.25.07.16.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 07:16:18 -0800 (PST) Date: Mon, 25 Feb 2019 10:16:16 -0500 From: "dennis@kernel.org" To: Peng Fan Cc: "tj@kernel.org" , "cl@linux.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "van.freenix@gmail.com" Subject: Re: [PATCH 2/2] percpu: km: no need to consider pcpu_group_offsets[0] Message-ID: <20190225151616.GB49611@dennisz-mbp.dhcp.thefacebook.com> References: <20190224132518.20586-1-peng.fan@nxp.com> <20190224132518.20586-2-peng.fan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190224132518.20586-2-peng.fan@nxp.com> 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 Sun, Feb 24, 2019 at 01:13:50PM +0000, Peng Fan wrote: > percpu-km is used on UP systems which only has one group, > so the group offset will be always 0, there is no need > to subtract pcpu_group_offsets[0] when assigning chunk->base_addr > > Signed-off-by: Peng Fan > --- > mm/percpu-km.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/percpu-km.c b/mm/percpu-km.c > index 66e5598be876..8872c21a487b 100644 > --- a/mm/percpu-km.c > +++ b/mm/percpu-km.c > @@ -67,7 +67,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) > pcpu_set_page_chunk(nth_page(pages, i), chunk); > > chunk->data = pages; > - chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; > + chunk->base_addr = page_address(pages); > > spin_lock_irqsave(&pcpu_lock, flags); > pcpu_chunk_populated(chunk, 0, nr_pages, false); > -- > 2.16.4 > While I do think you're right, creating a chunk is not a part of the critical path and subtracting 0 is incredibly minor overhead. So I'd rather keep the code as is to maintain consistency between percpu-vm.c and percpu-km.c. Thanks, Dennis