Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp587521pxv; Thu, 22 Jul 2021 07:36:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWbARurdPlp0nElUvMHFhzEWw2hwvNByeSGWPXghEvVRBKvi7O0arwRNdkXEkQ1xqk4LEi X-Received: by 2002:a02:a115:: with SMTP id f21mr35618303jag.3.1626964565863; Thu, 22 Jul 2021 07:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626964565; cv=none; d=google.com; s=arc-20160816; b=DsEVP7RSSxAJlKINkNQQD4JPa/0rP2HkvcukaQBCcNURYtqgeZHmU/VRNbXocwV7XG 5AafuhcGJML6H/nIS/kK6fJc2ydqbwEdJ9Zm414s8IR/L9mCfLcEK1Vgc3DJJbBKHzWF TkW7vx8fy8XhBWiPOaDxWC+EY3QlF6n2NWNpbYwOiOeTKSkYnQ2Ivcg3aH0Y5OiVpxnL e99iYOu9oEDh0CMWZhRAmet1oZaWKwValvzHJV/7msN8LsSy+ZjrgG1Wyo6HQxuYLS9w ltgvWof8V3Gyq+WADXBr5yfiIpsMJFzx1zITTpVwPI/8kLjjqyOprsrQkUNESlSx8Ut0 OWZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JoQvWSbt6SW54dfwq8nTFQWZq5OjwOKf2hg/K4WfrbE=; b=HsAroaTipa0r3+N9UVgTVUL/03+0DO/L/u1yfoxPu135lVPbm99t49KZ49ERefDQfl 57K1+riR+iSEdv4diCsRUhSpUDEjQdHCDXn9Xj7wdpLquAG7YZcwF1zvSB48qN6ZZ6JF WPTWoeIEYR3X2vgKlmLqV2HAWS+Us/Y9PC76hR95lN8eB8q85NkJGwhYUmgX8lqcqfXt DmRL4m9HPL02gaaZrmq9U/cr4wl7LbfM4tkaXd+Ft2uXgAL0jgBAusWaRE2NSj/a4ijW d1qjfTiX96odLX7Ma18Imcu3KYi4tytekI9SOojIVL3G8Va/hEWC759zA96vm1AcX+Su TLNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mztzqYmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si28180433ioq.67.2021.07.22.07.35.53; Thu, 22 Jul 2021 07:36:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mztzqYmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232361AbhGVNx4 (ORCPT + 99 others); Thu, 22 Jul 2021 09:53:56 -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.