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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 B8A5BC433E1 for ; Tue, 14 Jul 2020 03:41:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7B0C521973 for ; Tue, 14 Jul 2020 03:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pn4xLHed" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B0C521973 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0355D8D0003; Mon, 13 Jul 2020 23:41:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F01328D0001; Mon, 13 Jul 2020 23:41:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC8318D0003; Mon, 13 Jul 2020 23:41:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id C12CF8D0001 for ; Mon, 13 Jul 2020 23:41:14 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 43BF9180AD807 for ; Tue, 14 Jul 2020 03:41:14 +0000 (UTC) X-FDA: 77035280868.20.cloth84_160855d26eed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 1651E180C0609 for ; Tue, 14 Jul 2020 03:41:14 +0000 (UTC) X-HE-Tag: cloth84_160855d26eed X-Filterd-Recvd-Size: 2270 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jul 2020 03:41:13 +0000 (UTC) Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (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 67C8D20890; Tue, 14 Jul 2020 03:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594698072; bh=SPL3nkj9HvC2j7rtwl00nNXwS53s+StgAz1Rltp3OXE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pn4xLHed5UErZazjYs75fzvgnaYZ3py3NH+VTIX724EC9TUqwdfrEv0jCtI5x3vj2 EcUQBE7VdW1zx031C74H8IiVcL3J+EpURqyQwsT7kCDHC7vukx4ZThuUXuj41Abqg/ EdHFmTdurMMLft9g//TwoWhWD6R5YzJPHJLQEJCw= Date: Mon, 13 Jul 2020 20:41:11 -0700 From: Eric Biggers To: Hillf Danton Cc: syzbot , akpm@linux-foundation.org, arve@android.com, christian@brauner.io, devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, hughd@google.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, maco@android.com, syzkaller-bugs@googlegroups.com, tkjos@android.com, Markus Elfring Subject: Re: possible deadlock in shmem_fallocate (4) Message-ID: <20200714034111.GD1696@sol.localdomain> References: <0000000000000b5f9d059aa2037f@google.com> <20200714033252.8748-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714033252.8748-1-hdanton@sina.com> X-Rspamd-Queue-Id: 1651E180C0609 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000255, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jul 14, 2020 at 11:32:52AM +0800, Hillf Danton wrote: > > Add FALLOC_FL_NOBLOCK and on the shmem side try to lock inode upon the > new flag. And the overall upside is to keep the current gfp either in > the khugepaged context or not. > > --- a/include/uapi/linux/falloc.h > +++ b/include/uapi/linux/falloc.h > @@ -77,4 +77,6 @@ > */ > #define FALLOC_FL_UNSHARE_RANGE 0x40 > > +#define FALLOC_FL_NOBLOCK 0x80 > + You can't add a new UAPI flag to fix a kernel-internal problem like this. - Eric