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.6 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 9EF98C63793 for ; Thu, 22 Jul 2021 14:34:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3518361285 for ; Thu, 22 Jul 2021 14:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3518361285 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A6B856B0036; Thu, 22 Jul 2021 10:34:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A19D76B005D; Thu, 22 Jul 2021 10:34:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 908866B006C; Thu, 22 Jul 2021 10:34:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 737F56B0036 for ; Thu, 22 Jul 2021 10:34:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2338722896 for ; Thu, 22 Jul 2021 14:34:36 +0000 (UTC) X-FDA: 78390469752.13.D788465 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 4CE9AF00021A for ; Thu, 22 Jul 2021 14:34:35 +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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=JoQvWSbt6SW54dfwq8nTFQWZq5OjwOKf2hg/K4WfrbE=; b=mztzqYmyrfFAEWbV2CbDFhUOXR cEzYUywmqyUMsCLXrc3bVj/8TenC/M8GeZ2GWlBhTFz9//PSBU/ElGsjV+jUg01gN2yDEr4AEo0c1 vrrzr2xcPj+XxkeWUNhtzv/sxAAH32AFvB7FiZDw5f+5vQH+6S+p6I0cok1ml0jR++fQ0/y+43cSV J0EDbj69m7yMV+m1ZZKVVDpXzWTno8KflCrL9L463/L4H5WcX+ttBDw3C93SsIYMySQCRY0p7VP9T 30N32vApe7OorUFlCpdazvACkB1JNiB5yzr5X3gq/Ca4wVzZniayL2xSXeHdLxb/FS0pSxrcMJlXf F7zkIJ6w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6ZmF-00ALhz-KV; Thu, 22 Jul 2021 14:34:23 +0000 Date: Thu, 22 Jul 2021 15:34:19 +0100 From: Matthew Wilcox To: Dmitry Osipenko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Theodore Y. Ts'o" Subject: Re: [PATCH v14 062/138] mm/migrate: Add folio_migrate_copy() Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-63-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=mztzqYmy; 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; dmarc=none X-Rspamd-Server: rspam02 X-Stat-Signature: zxupdjb4piaagcmqbhmgpogg5oe6pt4i X-Rspamd-Queue-Id: 4CE9AF00021A X-HE-Tag: 1626964475-260833 Content-Transfer-Encoding: quoted-printable 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 Thu, Jul 22, 2021 at 04:45:59PM +0300, Dmitry Osipenko wrote: > 22.07.2021 15:29, Matthew Wilcox =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > On Thu, Jul 22, 2021 at 02:52:28PM +0300, Dmitry Osipenko wrote: > ... > > The obvious solution is just to change folio_copy(): > >=20 > > { > > - unsigned i, nr =3D folio_nr_pages(src); > > + unsigned i =3D 0; > > + unsigned nr =3D folio_nr_pages(src); > >=20 > > - for (i =3D 0; i < nr; i++) { > > - cond_resched(); > > + for (;;) { > > copy_highpage(folio_page(dst, i), folio_page(src, i))= ; > > + if (i++ =3D=3D nr) >=20 > This works with the ++i precedence change. Thanks! Thanks for testing! (and fixing my bug) I just pushed out an update to for-next with this fix. > The fs/ and mm/ are mostly outside of my scope, hope you'll figure out > the buffer-head case soon. Thanks. We don't need it fixed yet, but probably in the next six months.