Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp242324imj; Wed, 13 Feb 2019 07:37:02 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia+7B/Z1rvZhWAar7wSjYS0SKx+FzONt1nrRyPsxxzj9Wc9gvMYTnm/1cOWoPa8LAG61jv8 X-Received: by 2002:a63:6a07:: with SMTP id f7mr1023383pgc.118.1550072221968; Wed, 13 Feb 2019 07:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550072221; cv=none; d=google.com; s=arc-20160816; b=zhMtmYHllakTyEXvcRGrognImGU2GxrQZURjGnzh8gFh11GPg1FIh3VxzZB/qreNVy uCp0c2odRfvaPAEx5YUR8+p6V6L5uEjbVlgj3wtpRDSVS5JyixQhp5b+9zYdYvXdyQA8 lNWljRKRffKJJypUFN+0q96IvnBDES20v5xec6ZQLFafdgnlznETqUr0CtpJ06L9wcDb lC4P+IUwxpeZmdER3q5uWduUq1nXlpa8Oitl1DJSeFGzS/OcBajzZJ0XLbPr6leC1Za/ MHpJPAFAF7nj2JloFjzef+bIbTmagEpceyTJDjLWe2z+rIAILbvt2WOdYef3xsWtViQ3 CHmg== 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=UkQP6RJr6mQTndN2vKj0pb1bUJ0hTLSnjgtAB2OYBuc=; b=cp4lUPVMrkxsPNIplRodjzAInvhhioSQ9zPP0JTtHLWMJETHcJTPoWXUnc8Z7reqIZ 6kDmp5wceub74g6sOUmb+5AXfH4Nw6zInYBBMBf4Wgytr/WdHOkl+m/6F1DIdAaJR8T+ xnglxwgOv3/Sag7soHmMIW7KIjuA3CuzN0CeFNpVB4h/oEI2ATlfAWLHPnEaiko4jy2p 9LU1PZIZrmQBlbbd0n6/kSZD3RE6D/SqK9+dwfSDrgr8ZJMjFA2CEpyMdMByMDjVT/Oj GccCUIKyX4KIPb3X9s1gqtQT7lqA/YmQgz39OyBffQ1eHwnBpHgrtxRcbwgTe0sBj+ZG +rrQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si17144032pfq.56.2019.02.13.07.36.45; Wed, 13 Feb 2019 07:37:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389017AbfBMPGf (ORCPT + 99 others); Wed, 13 Feb 2019 10:06:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:34050 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726317AbfBMPGf (ORCPT ); Wed, 13 Feb 2019 10:06:35 -0500 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 AA3C4AE7F; Wed, 13 Feb 2019 15:06:33 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B2BDC1E09CD; Wed, 13 Feb 2019 16:06:32 +0100 (CET) Date: Wed, 13 Feb 2019 16:06:32 +0100 From: Jan Kara To: Christopher Lameter Cc: Jan Kara , Jason Gunthorpe , Dan Williams , Matthew Wilcox , Ira Weiny , Dave Chinner , Doug Ledford , lsf-pc@lists.linux-foundation.org, linux-rdma , Linux MM , Linux Kernel Mailing List , John Hubbard , Jerome Glisse , Michal Hocko Subject: Re: [LSF/MM TOPIC] Discuss least bad options for resolving longterm-GUP usage by RDMA Message-ID: <20190213150632.GB26828@quack2.suse.cz> References: <20190211180654.GB24692@ziepe.ca> <20190211181921.GA5526@iweiny-DESK2.sc.intel.com> <20190211182649.GD24692@ziepe.ca> <20190211184040.GF12668@bombadil.infradead.org> <20190211204945.GF24692@ziepe.ca> <20190211210956.GG24692@ziepe.ca> <20190212163433.GD19076@quack2.suse.cz> <01000168e2a26936-eb7cef59-9772-4a76-b7f3-a7fdc864fa72-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01000168e2a26936-eb7cef59-9772-4a76-b7f3-a7fdc864fa72-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 12-02-19 16:55:21, Christopher Lameter wrote: > On Tue, 12 Feb 2019, Jan Kara wrote: > > > > Isn't that already racy? If the mmap user is fast enough can't it > > > prevent the page from becoming freed in the first place today? > > > > No, it cannot. We block page faulting for the file (via a lock), tear down > > page tables, free pages and blocks. Then we resume faults and return > > SIGBUS (if the page ends up being after the new end of file in case of > > truncate) or do new page fault and fresh block allocation (which can end > > with SIGBUS if the filesystem cannot allocate new block to back the page). > > Well that is already pretty inconsistent behavior. Under what conditions > is the SIGBUS occurring without the new fault attempt? I probably didn't express myself clearly enough. I didn't say that SIGBUS can occur without a page fault. The evaluation of whether a page would be beyond EOF, page allocation, and block allocation happen only in response to a page fault... > If a new fault is attempted then we have resource constraints that could > have caused a SIGBUS independently of the truncate. So that case is not > really something special to be considered for truncation. Agreed. I was just reacting to Jason's question whether an application cannot prevent page freeing by being aggressive enough. Honza -- Jan Kara SUSE Labs, CR