Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp816849img; Tue, 26 Feb 2019 09:05:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IbuJU9sjsZUWWbbtwG3d4uThePeKjnN8+B80fUrhrya2bg3KdHmBFJ5U+ucwFII0AeuncVz X-Received: by 2002:a63:a609:: with SMTP id t9mr16741458pge.33.1551200713710; Tue, 26 Feb 2019 09:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551200713; cv=none; d=google.com; s=arc-20160816; b=ZJf3hZvrAqgVT4A/KW0xLIDbRfPREeZ6+OG37EE3M+sWZAB8q793ZuKv2Q+qnvClyH LJbjYzW1Y1w6+v603JoaRpHG1cWwrqOAHtSvN959v3NL6TPX1vSnmNLjBwz/Y35TvTL2 AVztZTmDe6nBYYcLyiXpgsbL1kNBhvh0LcvMa5kltHP5kpsN0UPnmKmkVm/gE0pHZh9T CqrLvg6Yp/5lHxYrlAE8JFinAHU2WP4xSu9Gr7jM3Se109uyoTVXTiSpO1OT1oEq/v3s 48q0tWpzL43JV9QQun9Y9rFr0bg4iUF0/5xwIWSrxHYNzbEXwGx264SC3PUQY17Kzm0u vqYw== 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=AYQDhdjbYQUyfL+3XviMbb8a/BeQjAxJJtDJUDHwgLM=; b=A4gkXGYaWbcY93aq+5DJ/iFEai3kzOy/9qRIR9ZFtyOc2f5DN/YZ1qrw/SgTrl6VxY DQhROqcCTh/5xgAW050PlEKj/6L3y6sg+6zxXWELtRINoiYERY/9GND059LEu+ZqyDFD fs1EGn9mfkuQvqRsmKALD7KzGo5EyM6f9OHyyaJo62jD2zBBlgrXa9frvFFl1uw15nEt 1pnJehA+TP3cG0TQuOlLQnPymFoO+ccxN9I39n3fs4lQwP8G4VKeTGTw4nH0wc4hnNL5 hwWHUGExaGANZmpRQfezbF2aBZZdgGRkt4p+5OY8rQsqshJzRf3MY93J3hhDED4+0GvF o9QQ== 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 r6si12901413plo.269.2019.02.26.09.04.38; Tue, 26 Feb 2019 09:05:13 -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 S1727629AbfBZRDo (ORCPT + 99 others); Tue, 26 Feb 2019 12:03:44 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:35641 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbfBZRDn (ORCPT ); Tue, 26 Feb 2019 12:03:43 -0500 Received: by mail-yw1-f67.google.com with SMTP id s204so5733515ywg.2 for ; Tue, 26 Feb 2019 09:03:43 -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=AYQDhdjbYQUyfL+3XviMbb8a/BeQjAxJJtDJUDHwgLM=; b=qVlInmvQYzPWKIN+Ybjlitxi/iiXbBiGc7fBZ2l/3uEIVKzMZ+Ghf2lrY4HZ4e1UYj zoek3c8pd1V5xRAgUd5ul+k0UYYjf1VSz4nSGfzbR/usZFcrpVz8R2ls1ny9ZAQHSWtX kug1Mj8o4JlckSKUnuzTSES4P5BOsWCccdZ+onOmGIZ4/Hmk0PedMNv3U09/jpyrrqYz UunXIRQUiuW9UMxXG+3LRzhGU2X2OFk4+mUaXUoAlEbGHJmy4xs1EkAsnHJkT2zwtdkZ yupyJ2soOvYDpl4FdWmIlf9Q7S0Xsu16CiR0/cWsZK/qeZ2uD1ZdNde5nqup6rsQiQH1 y1JQ== X-Gm-Message-State: AHQUAuYliHUcQQ8XpcQDlJQKdp4DNtYF2PgqPeHYX2pso89Q4741SDIz Tf/kEwlQP7SIXyTrRgYIUyg= X-Received: by 2002:a25:d44c:: with SMTP id m73mr18018663ybf.349.1551200623043; Tue, 26 Feb 2019 09:03:43 -0800 (PST) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::2:7f17]) by smtp.gmail.com with ESMTPSA id 207sm3527372ywm.67.2019.02.26.09.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 09:03:42 -0800 (PST) Date: Tue, 26 Feb 2019 12:03:39 -0500 From: Dennis Zhou To: Christopher Lameter Cc: Peng Fan , "tj@kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "van.freenix@gmail.com" Subject: Re: [PATCH 1/2] percpu: km: remove SMP check Message-ID: <20190226170339.GB47262@dennisz-mbp.dhcp.thefacebook.com> References: <20190224132518.20586-1-peng.fan@nxp.com> <20190225151330.GA49611@dennisz-mbp.dhcp.thefacebook.com> <010001692a612815-46229701-ea3f-4a89-8f88-0c74194ba257-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010001692a612815-46229701-ea3f-4a89-8f88-0c74194ba257-000000@email.amazonses.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 Tue, Feb 26, 2019 at 03:16:44PM +0000, Christopher Lameter wrote: > On Mon, 25 Feb 2019, Dennis Zhou wrote: > > > > @@ -27,7 +27,7 @@ > > > * chunk size is not aligned. percpu-km code will whine about it. > > > */ > > > > > > -#if defined(CONFIG_SMP) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK) > > > +#if defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK) > > > #error "contiguous percpu allocation is incompatible with paged first chunk" > > > #endif > > > > > > -- > > > 2.16.4 > > > > > > > Hi, > > > > I think keeping CONFIG_SMP makes this easier to remember dependencies > > rather than having to dig into the config. So this is a NACK from me. > > But it simplifies the code and makes it easier to read. > > I think the check isn't quite right after looking at it a little longer. Looking at x86, I believe you can compile it with !SMP and CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK will still be set. This should still work because x86 has an MMU. I think more correctly it would be something like below, but I don't have the time to fully verify it right now. Thanks, Dennis --- diff --git a/mm/percpu-km.c b/mm/percpu-km.c index 0f643dc2dc65..69ccad7d9807 100644 --- a/mm/percpu-km.c +++ b/mm/percpu-km.c @@ -27,7 +27,7 @@ * chunk size is not aligned. percpu-km code will whine about it. */ -#if defined(CONFIG_SMP) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK) +#if !defined(CONFIG_MMU) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK) #error "contiguous percpu allocation is incompatible with paged first chunk" #endif