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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 66298C4338F for ; Mon, 26 Jul 2021 12:47:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D48F60F46 for ; Mon, 26 Jul 2021 12:47:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D48F60F46 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 84E826B0033; Mon, 26 Jul 2021 08:47:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FF618D0002; Mon, 26 Jul 2021 08:47:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6ED748D0001; Mon, 26 Jul 2021 08:47:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 55E086B0033 for ; Mon, 26 Jul 2021 08:47:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E38DD20BF5 for ; Mon, 26 Jul 2021 12:47:02 +0000 (UTC) X-FDA: 78404713884.04.5DA983C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 15BC2F008214 for ; Mon, 26 Jul 2021 12:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YnYb8vRrXr3FxlNbM7BmLabWx+TSAadNbGAbdiZoOjA=; b=A1iU3VboJ6FOB2nV65zruUFHye 3IRBDvTt4YJWQRJtChVduRiQcjsa78Imto78cOV/HAQpQ9WrfndEQE71hjNiA6Tf/jh0LJvQtF3Ea MoO4djcVS2Szb1lVU7k7IKpyO+iJZ4oWfses1AZ05UJQJy68+i9bWCVytGOBFh/iIeJg+bSZ+jHyk 5LiAGbsilJ1P2D8TfSsB03woWu3EH2ljle5uOT7EAwF1U6xR6URAygQscUZ2Q0K3YbQ99jAv53m8n RH+tJ6dsxe50F/w9HiNZraSfBIzZ9jUiaxh6QZNSxpTJUBgF9TTAzNmCUm0i+fOSentrW5Jvh7mxH VduRG/7Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7zzI-00DxU2-AC; Mon, 26 Jul 2021 12:46:06 +0000 Date: Mon, 26 Jul 2021 13:45:40 +0100 From: Matthew Wilcox To: Andrew Morton Cc: syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] BUG: sleeping function called from invalid context in folio_copy Message-ID: References: <000000000000f84cad05c7ee4778@google.com> <20210725221834.35e077daff0005f3d78d08d7@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210725221834.35e077daff0005f3d78d08d7@linux-foundation.org> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 15BC2F008214 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=A1iU3Vbo; dmarc=none; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: 3ktm89uatks9nbgsczhui5hi87g4o48q X-HE-Tag: 1627303620-232345 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: On Sun, Jul 25, 2021 at 10:18:34PM -0700, Andrew Morton wrote: > (Cc Matthew) > > (It might not be a folio thing at all - I haven't checked yet) Already fixed, thanks. folio_copy() had a cond_resched() in it, even if it was only copying a single page. Now it only calls cond_resched() if it's copying more than one page. We discussed this in the folio call on Friday, because we're leaving a bit of a landmine here for whoever tries to make multi-page folios work with buffer_heads. There's not much we can do about it for now; it'll just be one of the many problems to be dealt with. Hopefully filesystems will convert to iomap instead of trying to make buffer_heads support multiple pages.