Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752576AbcC3Kxl (ORCPT ); Wed, 30 Mar 2016 06:53:41 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:17126 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130AbcC3Kxj (ORCPT ); Wed, 30 Mar 2016 06:53:39 -0400 Subject: Re: [PATCH] Revert "mm/page_alloc: protect pcp->batch accesses with ACCESS_ONCE" To: Mel Gorman References: <1459333327-89720-1-git-send-email-hekuang@huawei.com> <20160330103839.GA4773@techsingularity.net> CC: , , , , , , , , , , , , From: Hekuang Message-ID: <56FBAFA0.3010604@huawei.com> Date: Wed, 30 Mar 2016 18:51:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160330103839.GA4773@techsingularity.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.110.55.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.56FBAFB3.0114,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e0256d7712c8a825e4ffabee40b85ab5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 479 Lines: 14 hi 在 2016/3/30 18:38, Mel Gorman 写道: > On Wed, Mar 30, 2016 at 10:22:07AM +0000, He Kuang wrote: >> This reverts commit 998d39cb236fe464af86a3492a24d2f67ee1efc2. >> >> When local irq is disabled, a percpu variable does not change, so we can >> remove the access macros and let the compiler optimize the code safely. >> > batch can be changed from other contexts. Why is this safe? > I've mistakenly thought that per_cpu variable can only be accessed by that cpu. Thanks.