Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6952398imu; Thu, 31 Jan 2019 02:24:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN5wXMgSktYHTxx7j8O72ivcMcm5m4x2GIT8zhZlpckzWrk2XXXMKGZeUMJFKJrQWl6RwEyy X-Received: by 2002:a62:130c:: with SMTP id b12mr34432054pfj.247.1548930283305; Thu, 31 Jan 2019 02:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548930283; cv=none; d=google.com; s=arc-20160816; b=AtKRrZh1es+t9+oOXTNPZY9xeSaprqA4f9ZZ296vyyBDpIpLXSnEkSX6nmDh4NgcT4 EC6YZ7rQdgvdSa0hDUiqGfvMvKgCNvCA5u9IHSgSaQtLMr3MYyqi/zIQeExZ2Sf07X5c VbXMePu8Flw9cM5sswsyheba9AgFG/gUtLf4il8dp/3Ud5SqvxoVYNWpN0vhnOqNJaIQ zorAT0quw5bGYvtU0xk4bSTQh75n8gG3rvi0aP6GoAHv2e6iCVUBPK9Uelxs8eHn4Hy3 tD6rxIlinT0G6Rn5J3I5S+IZqPjuQDXQJEBy7eWDywdZykGsMcwS9UJ/gBKFztP9/tPz gzow== 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=vSTPWU0/sT5EebRTZSfumSnbMN+E7dxb8tiuKW3ZPa0=; b=EWLT/c/qYBVDH4pmsaMfzl2FSPNf53JE6ihKlW9HXLCIeYsChgWGVnyJQSmUOi8pG8 SYbZRcZGUNy948BzCV7Bv1U9YcsMKwphxyIiaGr6h14FUQzsVwkZHNQSpHQ+ESsYXIFr 4l6jL3J3XGwrkrEhI1c/OojsFEUud4ibv5FVadSTbUPlKu8IhqIeUREnlkYF5OKg0vyG XuSllMlHmLcerZ1/TULbcJJDpId29Q6H0MAYM+dIwAB8x1Qrn/fQXhPprg0jL+k7Q1Rn qDhkyowF2KtjP8S5BnNNO6WxYQ6xxlPI0ukxekNzpbZhw8rX0560ah73oUv5daOc6Yyn thoA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d33si4122930pla.359.2019.01.31.02.24.27; Thu, 31 Jan 2019 02:24:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731988AbfAaKXv (ORCPT + 99 others); Thu, 31 Jan 2019 05:23:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:53104 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726462AbfAaKXv (ORCPT ); Thu, 31 Jan 2019 05:23:51 -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 7619CB049; Thu, 31 Jan 2019 10:23:49 +0000 (UTC) Date: Thu, 31 Jan 2019 11:23:48 +0100 From: Michal Hocko To: Jiri Kosina Cc: Vlastimil Babka , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Peter Zijlstra , Greg KH , Jann Horn , Dominique Martinet , Andy Lutomirski , Dave Chinner , Kevin Easton , Matthew Wilcox , Cyril Hrubis , Tejun Heo , "Kirill A . Shutemov" , Daniel Gruss , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/3] mm/filemap: initiate readahead even if IOCB_NOWAIT is set for the I/O Message-ID: <20190131102348.GT18811@dhcp22.suse.cz> References: <20190130124420.1834-1-vbabka@suse.cz> <20190130124420.1834-3-vbabka@suse.cz> <20190131095644.GR18811@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 31-01-19 11:15:28, Jiri Kosina wrote: > On Thu, 31 Jan 2019, Michal Hocko wrote: > > > > diff --git a/mm/filemap.c b/mm/filemap.c > > > index 9f5e323e883e..7bcdd36e629d 100644 > > > --- a/mm/filemap.c > > > +++ b/mm/filemap.c > > > @@ -2075,8 +2075,6 @@ static ssize_t generic_file_buffered_read(struct kiocb *iocb, > > > > > > page = find_get_page(mapping, index); > > > if (!page) { > > > - if (iocb->ki_flags & IOCB_NOWAIT) > > > - goto would_block; > > > page_cache_sync_readahead(mapping, > > > ra, filp, > > > index, last_index - index); > > > > Maybe a stupid question but I am not really familiar with this path but > > what exactly does prevent a sync read down page_cache_sync_readahead > > path? > > page_cache_sync_readahead() only submits the read ahead request(s), it > doesn't wait for it to finish. OK, I guess my question was not precise. What does prevent taking fs locks down the path? -- Michal Hocko SUSE Labs