From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4721C352AA for ; Tue, 1 Oct 2019 08:40:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9ED0C215EA for ; Tue, 1 Oct 2019 08:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9ED0C215EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 37C4E8E0005; Tue, 1 Oct 2019 04:40:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 306898E0001; Tue, 1 Oct 2019 04:40:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CDCD8E0005; Tue, 1 Oct 2019 04:40:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id E97BA8E0001 for ; Tue, 1 Oct 2019 04:40:26 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 5916662D1 for ; Tue, 1 Oct 2019 08:40:26 +0000 (UTC) X-FDA: 75994569252.04.car79_20dddb951a00d X-HE-Tag: car79_20dddb951a00d X-Filterd-Recvd-Size: 4162 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Oct 2019 08:40:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 39C62AFB2; Tue, 1 Oct 2019 08:40:22 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 301AB1E37A2; Tue, 1 Oct 2019 10:40:39 +0200 (CEST) Date: Tue, 1 Oct 2019 10:40:39 +0200 From: Jan Kara To: Peter Zijlstra Cc: Jan Kara , John Hubbard , Michal Hocko , "Kirill A. Shutemov" , Yu Zhao , Andrew Morton , "Kirill A . Shutemov" , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Vlastimil Babka , Hugh Dickins , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrea Arcangeli , "Aneesh Kumar K . V" , David Rientjes , Matthew Wilcox , Lance Roy , Ralph Campbell , Jason Gunthorpe , Dave Airlie , Thomas Hellstrom , Souptick Joarder , Mel Gorman , Mike Kravetz , Huang Ying , Aaron Lu , Omar Sandoval , Thomas Gleixner , Vineeth Remanan Pillai , Daniel Jordan , Mike Rapoport , Joel Fernandes , Mark Rutland , Alexander Duyck , Pavel Tatashin , David Hildenbrand , Juergen Gross , Anthony Yznaga , Johannes Weiner , "Darrick J . Wong" , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 3/4] mm: don't expose non-hugetlb page to fast gup prematurely Message-ID: <20191001084039.GC25062@quack2.suse.cz> References: <20190925082530.GD4536@hirez.programming.kicks-ass.net> <20190925222654.GA180125@google.com> <20190926102036.od2wamdx2s7uznvq@box> <9465df76-0229-1b44-5646-5cced1bc1718@nvidia.com> <20190927123056.GE26848@dhcp22.suse.cz> <20190930092003.GA22118@quack2.suse.cz> <6bba357a-1706-7cdb-8a11-359157a21ae8@nvidia.com> <20191001071008.GA25062@quack2.suse.cz> <20191001083604.GM4519@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001083604.GM4519@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 01-10-19 10:36:04, Peter Zijlstra wrote: > On Tue, Oct 01, 2019 at 09:10:08AM +0200, Jan Kara wrote: > > On Mon 30-09-19 10:57:08, John Hubbard wrote: > > > > Well, a couple of questions: > > > > > > 1. Is there *really* a memory barrier in try_get_compound_head()? Because > > > I only see a READ_ONCE compile barrier, which would mean that run time > > > reordering is still possible. > > > > try_get_compound_head() has page_cache_add_speculative() which is > > atomic_add_unless() which is guaranteed to provide ordering. > > atomic_add_unless() only provides ordering on SUCCESS, now looking at > the code in question that seems sufficient, so all should be well. Just > wanted to let you know that if atomic_add_unless() FAILs there is no > implied ordering what so ever. Yeah, right, thanks for correction! Honza -- Jan Kara SUSE Labs, CR