Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6957197imu; Thu, 31 Jan 2019 02:30:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN7oV7RUwO9xYvcAExpOZym6WTm//JSx53VdO+5rBHunrHWnUw6syPddTvI+CFYQWuNquB8N X-Received: by 2002:aa7:8542:: with SMTP id y2mr34732952pfn.83.1548930656153; Thu, 31 Jan 2019 02:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548930656; cv=none; d=google.com; s=arc-20160816; b=qOfQ1ShR+Rz5XQkwUiO9e8h+IH126NwTTl87/cjBsSWggG3cvC4eAGAZkDmeWS7W0z lYPrlD5AT+SxgS0T3yCzPfjQ6OSDjH5Rmp4hV6DmfXyHzlYZLzd3yb+KJwcbvIfncjze Rpgcvv41/UEsCUSTmrszIIZa0eCLknDLUqWnZzBbLGIqMJtGhafC2nCvQMivNj2v6+Ms SByX36kQ2IlKVBWjxssWadGEubdbH0Gq5QgjoC0YxvcN0fLaBNRwbx8N9rAD9Xpojufa yzLo3+Vv80fF4zXeqxaLTbeLU8Aw7HG9nOCRGVVdTV8PuBjWLnkYBtgMkL1a0s731kDA G0tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=jjdfEJaEYqyHvE39Q3E9pHyf6stwD6p51MDgkNf625E=; b=vA4qAvX6OOmfxM5huHWPaXyJhuCoeNnseMxT1qxCeJMEDQOyZXwouGySCU+7Bzg8QO ZuJyVlYQ3ZwJyBx4YejuOi9KFybk+TbR99twnkbt6bu1rI9k2Cp3r8/GgxJDGozKySaJ b+25nWLznbcSVkRxgZH8zZGe+H8M+U3QKPF/42VPfTtOu2V7DOgnCD65SlnrWfwn8vQq TnC+czMKMtTvatCeLSuRv+BCZptzJ4+7DQV8eWwLyYFn1MSSStbnrGpdVSJud7xWYLCC HRo+kvmdQzjn2edizvjD1YWFfzTw5gAqR0FpxkBpTtVULFSCZNst15o2kkNYtfesBcG7 yeMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RJwgaBs8; 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=pass (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 k19si4014334pgn.20.2019.01.31.02.30.39; Thu, 31 Jan 2019 02:30:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=RJwgaBs8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfAaKab (ORCPT + 99 others); Thu, 31 Jan 2019 05:30:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:47526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbfAaKaa (ORCPT ); Thu, 31 Jan 2019 05:30:30 -0500 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01DA0218AC; Thu, 31 Jan 2019 10:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548930629; bh=Y2q2CGTr8DC8b5sUaWln1mdflBI54lRZC+oK9+sq4fg=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=RJwgaBs8AwKSAgm+Pqtpv5rDpOa/DdLevBF/0L1uyrwGGr3bMPou4mxv/Katajwu9 tw9/N/B0Jm9pmTP2tL7DqioyGhCkyQPaJ2Hcph7WIzpSCxIkHZ/kGNWUs4q3Ve/3j4 9b4MsooLv8MXcQ3kEoyWvgANTMXXXOdarH1dJqqU= Date: Thu, 31 Jan 2019 11:30:24 +0100 (CET) From: Jiri Kosina To: Michal Hocko 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 In-Reply-To: <20190131102348.GT18811@dhcp22.suse.cz> Message-ID: References: <20190130124420.1834-1-vbabka@suse.cz> <20190130124420.1834-3-vbabka@suse.cz> <20190131095644.GR18811@dhcp22.suse.cz> <20190131102348.GT18811@dhcp22.suse.cz> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Well, RWF_NOWAIT doesn't mean the kernel can't reschedule while executing preadv2(), right? It just means it will not wait for the arrival of the whole data blob into pagecache in case it's not there. -- Jiri Kosina SUSE Labs