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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 15088C43140 for ; Thu, 5 Sep 2019 18:29:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05CB520828 for ; Thu, 5 Sep 2019 18:29:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Qqt13/dN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05CB520828 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7133E6B0003; Thu, 5 Sep 2019 14:29:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69BD56B0005; Thu, 5 Sep 2019 14:29:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58A026B0008; Thu, 5 Sep 2019 14:29:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 321BC6B0003 for ; Thu, 5 Sep 2019 14:29:01 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id D0E0137F1 for ; Thu, 5 Sep 2019 18:29:00 +0000 (UTC) X-FDA: 75901703640.02.earth79_146ed1c639c02 X-HE-Tag: earth79_146ed1c639c02 X-Filterd-Recvd-Size: 2869 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 5 Sep 2019 18:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=acxEENEa/DqMCNqNx4aBDRRIK560ncz4Caqw5lxEPBs=; b=Qqt13/dNdTpOF/UEMQ73DriBY +VchaP0F0KycJLtkPdlJQqQZwlt+gUeo8pCDHDsHtHYir37mRbm5OPWy/dP9bgPQwRMrVYURW0iK9 OVVxf51ZsaBTSpRk+UxB27lvyLvXZxCYzonU11dcYngMZUt1fxBmaE5uPjC+Cjsx/IUWdvlgzmlsA XYJPwOjTlLcbCsguxdG7bUwe+mgHe/6JJ0aAQ5SdhVPrhKsA9kVMhgL/A10WKAArcXr2Lr5eUhUGD q2qdAGvs1zl26/WbEMyQ51kmnm9vJdCcTF872vqBB1Suv3o0Fu7k+Ud9+EcmEPfjwkdsFRw6MUrLH 8zrqFlqJg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i5wV9-0003Li-Gr; Thu, 05 Sep 2019 18:28:59 +0000 Date: Thu, 5 Sep 2019 11:28:59 -0700 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Kirill Shutemov , Song Liu , William Kucharski , Johannes Weiner Subject: Re: [PATCH 2/3] mm: Allow large pages to be added to the page cache Message-ID: <20190905182859.GR29434@bombadil.infradead.org> References: <20190905182348.5319-1-willy@infradead.org> <20190905182348.5319-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190905182348.5319-3-willy@infradead.org> User-Agent: Mutt/1.11.4 (2019-03-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 Thu, Sep 05, 2019 at 11:23:47AM -0700, Matthew Wilcox wrote: > + xas_for_each_conflict(&xas, old) { > + if (!xa_is_value(old)) > + break; > + exceptional++; > + if (shadowp) > + *shadowp = old; > + } > + if (old) { > xas_set_err(&xas, -EEXIST); > - xas_store(&xas, page); > + break; Of course, one cannot see one's own bugs until one has posted them publically. This will exit the loop with the lock held. > + } > + xas_create_range(&xas); > if (xas_error(&xas)) > goto unlock; > The stanza should read: if (old) xas_set_err(&xas, -EEXIST); xas_create_range(&xas); if (xas_error(&xas)) goto unlock; just like the corresponding stanza in mm/shmem.c. (while the xa_state is in an error condition, the xas_create_range() function will return without doing anything).