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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B04A6C04A95 for ; Wed, 28 Sep 2022 03:26:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3170C8E011B; Tue, 27 Sep 2022 23:26:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C6708E00C1; Tue, 27 Sep 2022 23:26:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18EF08E011B; Tue, 27 Sep 2022 23:26:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0DA4B8E00C1 for ; Tue, 27 Sep 2022 23:26:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3F91FA1160 for ; Wed, 28 Sep 2022 03:26:06 +0000 (UTC) X-FDA: 79960055532.20.691AC8D Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf20.hostedemail.com (Postfix) with ESMTP id B57061C001C for ; Wed, 28 Sep 2022 03:26:05 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id d10so10260365pfh.6 for ; Tue, 27 Sep 2022 20:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=To+MkJjyqyo7jncRu+HUvODDez2TVKQAug//Me+ROz4=; b=B6fdJzHXTDJJ2PhJJiDAAqrJQXgMnawDmP3QtixcjLGm566J8hbODf8sgSPeK9T7bm 5qS9Bd/G/lQYUq107JO66NCsvE9Z91fPHdm7ci86Bj4zjAYDlJNCw6f9fUwIQYKkzA2W AXeMRixGcPHO/99q9ZnNctpMgMEOcoDyAQ1ZaqEVNXxyAFu/nrxKe3VF/GJ2BzAdfSAJ V3kK+F5k35rGrFhA2Jd7gP2ooHt+BT+X3NKtw2sMHh2PmBhYYLoNiIrA7i09HhPPaeeS mqSRotcClaHooL/lE2xaqqgAth3xb/muA32B0QbxexxKcUrvxMCIBOmFfbbqpMSvPGgT ROYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=To+MkJjyqyo7jncRu+HUvODDez2TVKQAug//Me+ROz4=; b=lzjWdrKAvNGCMd+sHqKZLtvkmUa5NTYvYElt1Id17hhzlTdkAHL+PxUYmoym4H8Gyu LgoD7lfVD7f12tzgx2orkcVGsaLimu4gfjS65vWnE5eyym3n4JjjYfkXRRiYdbm/esaV REoZaoZ+53GmicJmWdjY3inHPfxfQSwc1GXwTewAw3KkZ39LNnQBaJp6SAlpOE/OHthZ /hn750bujbxXxj0bWYc2hRnFqPyj7w/gprWUg38g33Pr6O3nByx293SBdRUA7b+udcv/ hSuCuPCbuZ8TOL9QbbhLXXAya8c91eAniobfd6QpViB3QDz2WGNcJ95cfaqRxL9W9a62 Qnxw== X-Gm-Message-State: ACrzQf2as1qRJ1BFdpkViCWlvFoTmNXthNnrVun1v2RgS0dj2YDG/QMF DrMAMgKqflSXrtjWEQ+CdTzH725h+A7p+Xk1Vnw= X-Google-Smtp-Source: AMsMyM6L5rl3/JyTMMTbFcUfk64g1ng0jkNTfS8qvP0wh5l1kiGV/r3VGvZBVnhkhH3MgDkr6RLoKPgX4A5zLWa7H74= X-Received: by 2002:a63:5f16:0:b0:439:41a8:ab4e with SMTP id t22-20020a635f16000000b0043941a8ab4emr27305865pgb.195.1664335564729; Tue, 27 Sep 2022 20:26:04 -0700 (PDT) MIME-Version: 1.0 References: <20220921060616.73086-1-ying.huang@intel.com> <20220921060616.73086-3-ying.huang@intel.com> <87o7v2lbn4.fsf@nvdebian.thelocal> <87fsgdllmb.fsf@nvdebian.thelocal> <87ill937qe.fsf@yhuang6-desk2.ccr.corp.intel.com> <46807002-c42c-1232-0938-5b48050171ee@nvidia.com> <87pmfgjnpj.fsf@nvdebian.thelocal> <87czbg2s3b.fsf@yhuang6-desk2.ccr.corp.intel.com> <240bbb01-1f26-71ee-233a-ad65313ac358@nvidia.com> <4a44bf59-a984-8ac4-c613-a03d74dc6a5a@nvidia.com> <9d72f2ed-9a92-e67b-3af5-79050004a1a4@nvidia.com> In-Reply-To: <9d72f2ed-9a92-e67b-3af5-79050004a1a4@nvidia.com> From: Yang Shi Date: Tue, 27 Sep 2022 20:25:52 -0700 Message-ID: Subject: Re: [RFC 2/6] mm/migrate_pages: split unmap_and_move() to _unmap() and _move() To: John Hubbard Cc: "Huang, Ying" , Alistair Popple , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Zi Yan , Baolin Wang , Oscar Salvador , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B6fdJzHX; spf=pass (imf20.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664335565; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=To+MkJjyqyo7jncRu+HUvODDez2TVKQAug//Me+ROz4=; b=IPMeZ/4fwaNP0gjO+4q62HXCVUOE1SPtFkTNjFKtYq01OQgBJI/ZIkTaS5Lr6R47Q2pAjS /hTTiLOWL3bsazrQjaSBw22ZJV0CzDnK5ELW5e0L1RP04kQZrjZPQRh6oc1rlWod5MKXHg 4YkNCi5eRuYjBn4E7n9jvV5NQRKJuUM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664335565; a=rsa-sha256; cv=none; b=j93aIrZ+K47nmnz7t2NDYjHz7n/Fm/n+R/9AkABiJoczL0os6DGAfY7WnOuTIxIMED1eST S4cXlR4WKXQwz+vvw52S7lzzoFH74KgcpAX+VV0RfwcqVM/5+Tv1GO+p5R1XnZ5sj47zZk 3E5jQd9fnVT+o2mibb5YY7dcsrYUFa0= X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: B57061C001C X-Stat-Signature: xqb7fqoun7187snyjycnnyejc4dtae9z Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B6fdJzHX; spf=pass (imf20.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-HE-Tag: 1664335565-445019 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 Tue, Sep 27, 2022 at 7:57 PM John Hubbard wrote: > > On 9/27/22 19:14, Yang Shi wrote: > > IIRC, the writeback may not call generic_writepages. On my ext4 > > filesystem, the writeback call stack looks like: > > > > @[ > > ext4_writepages+1 > > do_writepages+191 > > __writeback_single_inode+65 > > writeback_sb_inodes+477 > > __writeback_inodes_wb+76 > > wb_writeback+457 > > wb_workfn+680 > > process_one_work+485 > > worker_thread+80 > > kthread+231 > > ret_from_fork+34 > > ]: 2 > > > > Sure, that's fine for ext4, in that particular case, but > > a) not all filesystems have .writepages hooked up. That's why > do_writepages() checks for .writepages(), and falls back to > .writepage(): > > if (mapping->a_ops->writepages) > ret = mapping->a_ops->writepages(mapping, wbc); > else > ret = generic_writepages(mapping, wbc); > > , and > > b) there are also a lot of places and ways to invoke writebacks. There > are periodic writebacks, and there are data integrity (WB_SYNC_ALL) > writebacks, and other places where a page needs to be cleaned--so, a lot > of call sites. Some of which will land on a .writepage() sometimes, even > now. > > For just one example, I see migrate.c's writeout() function directly > calling writepage(): > > rc = mapping->a_ops->writepage(&folio->page, &wbc); Thanks, John. You are right. I think "deprecated" is inaccurate, .writepage is actually no longer used in memory reclaim context, but it is still used for other contexts. Anyway I think what we tried to figure out in the first place is whether it is possible that filesystem writeback have dead lock with the new batch migration or not. I think the conclusion didn't change. > > > thanks, > > -- > John Hubbard > NVIDIA >