Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbbELJl6 (ORCPT ); Tue, 12 May 2015 05:41:58 -0400 Received: from mx2.parallels.com ([199.115.105.18]:56179 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752810AbbELJly (ORCPT ); Tue, 12 May 2015 05:41:54 -0400 Date: Tue, 12 May 2015 12:41:34 +0300 From: Vladimir Davydov To: Minchan Kim CC: Andrew Morton , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , , , , , , Rik van Riel , Hugh Dickins , Christoph Lameter , "Paul E. McKenney" , Peter Zijlstra Subject: Re: [PATCH v3 3/3] proc: add kpageidle file Message-ID: <20150512094134.GE17628@esperanza> References: <20150429043536.GB11486@blaptop> <20150429091248.GD1694@esperanza> <20150430082531.GD21771@blaptop> <20150430145055.GB17640@esperanza> <20150504031722.GA2768@blaptop> <20150504094938.GB4197@esperanza> <20150504105459.GA19384@blaptop> <20150508095604.GO31732@esperanza> <20150509151031.GA24141@blaptop> <20150510103429.GA17628@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150510103429.GA17628@esperanza> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1688 Lines: 34 On Sun, May 10, 2015 at 01:34:29PM +0300, Vladimir Davydov wrote: > On Sun, May 10, 2015 at 12:12:38AM +0900, Minchan Kim wrote: > > Yeb, I might be paranoid but my point is it might work now on most of > > arch but it seem to be buggy/fragile/subtle because we couldn't prove > > all arch/compiler don't make any trouble. So, intead of adding more > > logics based on fragile, please use right lock model. If lock becomes > > big trouble by overhead, let's fix it(for instance, use WRITE_ONCE for > > update-side and READ_ONCE for read-side) if I don't miss something. > > IMO, locking would be an overkill. READ_ONCE is OK, because it has no > performance implications, but I would prefer to be convinced that it is > 100% necessary before adding it just in case. Finally, I'm convinced we do need synchronization here :-) Sorry for being so stubborn and thank you for your patience. After examining page_referenced() with the knowledge that the compiler may be completely unreliable and split page->mapping read/writes as it wants, I've drawn the conclusion that it is safer to take page_zone->lru_lock for checking if the page is on an LRU list, just as you proposed initially, because otherwise we need to insert those READ/WRITE_ONCE in every nook and cranny, which would look confusing provided we only needed them for this idle page tracking feature, which might even be not compiled in. I'll fix it and resend. Thanks, Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/