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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 A511BC6377D for ; Thu, 22 Jul 2021 14:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F11561285 for ; Thu, 22 Jul 2021 14:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232378AbhGVNx5 (ORCPT ); Thu, 22 Jul 2021 09:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbhGVNxz (ORCPT ); Thu, 22 Jul 2021 09:53:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56890C061575; Thu, 22 Jul 2021 07:34:30 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22, 2021 at 04:45:59PM +0300, Dmitry Osipenko wrote: > 22.07.2021 15:29, Matthew Wilcox пишет: > > On Thu, Jul 22, 2021 at 02:52:28PM +0300, Dmitry Osipenko wrote: > ... > > The obvious solution is just to change folio_copy(): > > > > { > > - unsigned i, nr = folio_nr_pages(src); > > + unsigned i = 0; > > + unsigned nr = folio_nr_pages(src); > > > > - for (i = 0; i < nr; i++) { > > - cond_resched(); > > + for (;;) { > > copy_highpage(folio_page(dst, i), folio_page(src, i)); > > + if (i++ == nr) > > 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.