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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 AF408C433E1 for ; Thu, 30 Jul 2020 11:35:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 74E12207F5 for ; Thu, 30 Jul 2020 11:35:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="aXkEsqAc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74E12207F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 017D66B0002; Thu, 30 Jul 2020 07:35:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0C496B0005; Thu, 30 Jul 2020 07:35:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E20C46B0006; Thu, 30 Jul 2020 07:35:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id CCCA06B0002 for ; Thu, 30 Jul 2020 07:35:08 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5CBED8248D52 for ; Thu, 30 Jul 2020 11:35:08 +0000 (UTC) X-FDA: 77094535896.08.side11_280dc1126f7a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 335131819E773 for ; Thu, 30 Jul 2020 11:35:08 +0000 (UTC) X-HE-Tag: side11_280dc1126f7a X-Filterd-Recvd-Size: 4358 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 30 Jul 2020 11:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1596108908; x=1627644908; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=j41KC+1XDl93tyoex2UKMqkfEfMm8VkxpaoA98a3XK4=; b=aXkEsqAc3GoUmM1WA5VaFUouwGKBZ/FLXVTMElA56LEfkkgnmqJbJ/8n FE3gTyPn/mlhGCH8amFmnUksnp8cnZf/sl9iOQq+wgEiZAMv5RrOn8XHD Yw4Fwx7GEqAf2+JKG4vnUnesfIsF//+TZI9TpmH/alYyGeeTGQT3dY+/g s=; IronPort-SDR: H8ecPjeO38f1B/8hwViuPnOTe4Nzztp8Pwz6pkJnQHif/q/p9vvtXA2wSvyGz/sXcPr0RiN8ph vyvTeELyGtrw== X-IronPort-AV: E=Sophos;i="5.75,414,1589241600"; d="scan'208";a="45038184" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-62350142.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 30 Jul 2020 11:35:06 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-62350142.us-east-1.amazon.com (Postfix) with ESMTPS id DC61CA22F3; Thu, 30 Jul 2020 11:35:03 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Jul 2020 11:35:03 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.26) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Jul 2020 11:34:55 +0000 From: SeongJae Park To: , , CC: Andrew Morton , , "Josef Bacik" , Robert Stupp , Minchan Kim , Jan Kara Subject: Re: [PATCH] mm: Don't bother dropping mmap_sem for zero size readahead Date: Thu, 30 Jul 2020 13:34:35 +0200 Message-ID: <20200730113435.2280-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200212101356.30759-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.26] X-ClientProxiedBy: EX13D41UWC001.ant.amazon.com (10.43.162.107) To EX13D31EUA001.ant.amazon.com (10.43.165.15) X-Rspamd-Queue-Id: 335131819E773 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: Hello, The commit fixed by this patch[1] was merged in v5.1 and this patch was merged in the mainline in v5.7 (5c72feee3e45b40a3c96c7145ec422899d0e8964). Thus, the issue affects [v5.1, v5.6]. I was also able to reproduce the issue and confirm the fix works on v5.4 based kernels. However, I couldn't find this fix in neither latest stable/linux-5.4.y, nor stable-queue/master. Could you please put this patch in the queue? [1] https://lore.kernel.org/linux-mm/20200212101356.30759-1-jack@suse.cz/ Thanks, SeongJae Park On Wed, 12 Feb 2020 11:13:56 +0100 Jan Kara wrote: > When handling a page fault, we drop mmap_sem to start async readahead so > that we don't block on IO submission with mmap_sem held. However > there's no point to drop mmap_sem in case readahead is disabled. Handle > that case to avoid pointless dropping of mmap_sem and retrying the > fault. This was actually reported to block mlockall(MCL_CURRENT) > indefinitely. > > Fixes: 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking operations") > Reported-by: Minchan Kim > Reported-by: Robert Stupp > Signed-off-by: Jan Kara > --- > mm/filemap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Andrew, could you please pick up this patch? Minchan also tripped over this > bug... > > diff --git a/mm/filemap.c b/mm/filemap.c > index 1146fcfa3215..3d39c437b07e 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -2458,7 +2458,7 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf, > pgoff_t offset = vmf->pgoff; > > /* If we don't want any read-ahead, don't bother */ > - if (vmf->vma->vm_flags & VM_RAND_READ) > + if (vmf->vma->vm_flags & VM_RAND_READ || !ra->ra_pages) > return fpin; > if (ra->mmap_miss > 0) > ra->mmap_miss--; > -- > 2.16.4