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 70825C32771 for ; Wed, 28 Sep 2022 03:39:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D55768E011D; Tue, 27 Sep 2022 23:39:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CDE4C8E00C1; Tue, 27 Sep 2022 23:39:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B57E38E011D; Tue, 27 Sep 2022 23:39:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A35938E00C1 for ; Tue, 27 Sep 2022 23:39:37 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 698AC16111C for ; Wed, 28 Sep 2022 03:39:37 +0000 (UTC) X-FDA: 79960089594.08.29823EE Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf05.hostedemail.com (Postfix) with ESMTP id F28E010000C for ; Wed, 28 Sep 2022 03:39:36 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso2464115pjq.1 for ; Tue, 27 Sep 2022 20:39:36 -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=XYKAuPD3+GZdJQNHnghuXSWwE9LJi0wNzSXXCoPHwq8=; b=KBUM/cr7qDLk3npbruidlCg7uiE2f2C4OLbnVvnA/DOAYyDXsf3G0SliElNEC3GWMb Y9NNRmrZ9Tj+5cQAGuDZQnylk9hChk8W6de7XamGr/BYIi0o0OTiKukCB4TfwkbN8zTz LfbM0ql16bwNZNgOAtkQt132+55+o2rsi303+NLzG0RcbAjjOLtwZoRiJV44Gb6QB62I eGovjp7F4iwEw8f0jnxYDlpaj5qxyIA98Ld9MCF9PZFGJEWv/IRGET5cAl+f0D6q2+hy 6CNV/yXF9huDdTUV29v+4PfrA8WZ1zbysPzazjiWmKigmMkbOkNuw+CNBa2rghw/hVR0 COYw== 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=XYKAuPD3+GZdJQNHnghuXSWwE9LJi0wNzSXXCoPHwq8=; b=zC48oHx0mgTVmc2fvOEqsX3ZyCcs929JZQWi/hXs3OksAbbUY4I6ZY5AzLhrK4F7Uz BJmzFrye3l3K6aJi4TDQsNcaNY/Ku/viz9UaNpxIjuXpEq87NmvtMs68ohY5zyDNmyzq +IFXUxVZUNlaFCwBxe4dWu8GM1qE40UXO/0WOqNBwxKGuqGMyJl6JOZwe0ollq8KbP0r BktAOBKqZ1sY78ATRMPsDZ2CUhYrvqJNe0Kqb758+rlzqBeg/MRbrSdSIsap8V1Un3u3 qBKZ8y7z2slJcQ6UL/2gRGOnveXmeAHYLldrr5QXE/a7VDg5PhO549nM6Ehbuuhal9yt xQlg== X-Gm-Message-State: ACrzQf0L5MjHnjIYLCB2p6OR8YLpRGjEIkvEBlbfoLEEAh3hS8ne5ioR qRSYfXx98G8h+PHNXGl20erfBtfiUL9y1n08sDQ= X-Google-Smtp-Source: AMsMyM7clATObyreo5DgUnto3bkr7OKwcVru6n7A5tqcL2D8DL3YtLCLvd0xlSSHEotHCx0g77j5k2PuFs54vsPdDY8= X-Received: by 2002:a17:902:d508:b0:178:b7b1:beb3 with SMTP id b8-20020a170902d50800b00178b7b1beb3mr30772887plg.102.1664336375934; Tue, 27 Sep 2022 20:39:35 -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: From: Yang Shi Date: Tue, 27 Sep 2022 20:39:23 -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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664336377; a=rsa-sha256; cv=none; b=WcYsHVVLpGVS7pHLcHinuiIRz3sCZjsEVdBEHjoi5BMHe/r4gu/3zA0dPM63vUiAqi+p/E g3UKxyaKr2VwidTRasKglT/rpqZn+kALv+9vK1/bOqy9nztrK//bDqfjBDz9bQ40qlsHLK Pb+fqJAjqDfrETMBXQukqtdbtmYSgMo= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="KBUM/cr7"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=shy828301@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664336377; 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=XYKAuPD3+GZdJQNHnghuXSWwE9LJi0wNzSXXCoPHwq8=; b=2/dS99poFQMqf5Tai1NAnO61IdKo776n2VBvYi6GmxIMHu2hmwfJ4tXtXWuuQhOCZ/y3gY rIG8CumDmGbBQmnNjQwQnLpa5CPeL0uTXC+IGGhmoSRpcbSBecrcWgkL3a2mWP67oX5/uV 1G9jPeNSA8vK1TPsDGMrCKYsf4i41uE= X-Stat-Signature: ptkbwxa5sewmcytwyz7ubyb9u3mn4t8p X-Rspamd-Queue-Id: F28E010000C X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="KBUM/cr7"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam11 X-HE-Tag: 1664336376-42868 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 8:25 PM Yang Shi wrote: > > 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. Hmm.. it is definitely used currently, but it seems like the plan is to deprecate ->writepage finally IIUC. See https://lore.kernel.org/linux-mm/YvQYjpDHH5KckCrw@casper.infradead.org/ > > 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 > >