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 031A6E77197 for ; Wed, 8 Jan 2025 01:40:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 716786B007B; Tue, 7 Jan 2025 20:40:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C61A6B0083; Tue, 7 Jan 2025 20:40:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58E296B008A; Tue, 7 Jan 2025 20:40:38 -0500 (EST) 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 37BF06B007B for ; Tue, 7 Jan 2025 20:40:38 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E506BAFDA2 for ; Wed, 8 Jan 2025 01:40:37 +0000 (UTC) X-FDA: 82982580114.18.CB9ECB6 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf05.hostedemail.com (Postfix) with ESMTP id 6B243100010 for ; Wed, 8 Jan 2025 01:40:34 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=hPygx2Wn; spf=pass (imf05.hostedemail.com: domain of jefflexu@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=jefflexu@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736300436; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=e44YPIJX7mdgwR9QtS4wdSipveX6mt2j2rqrldUApVk=; b=6wEV8EO6uM6zXejafYuF8CdL7SbjKjNyQRKiBzoJwompSCHQ6LmPFTDdqEupMMO4RDW12G QZrABOdh1TgDmcQw+m6ylnMGenAd6R7uXt9E1kv26KPNjaehO/svZa4NnX/8JdJsKJaJ9h FknCWHxGTXUfIiolNpfsAs9vEzpyoDo= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=hPygx2Wn; spf=pass (imf05.hostedemail.com: domain of jefflexu@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=jefflexu@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736300436; a=rsa-sha256; cv=none; b=sMjpMBgnzNc3hnLxWMbceasve7TcxFrhE9LRDTNlKzzl/E2yph/As+ADOBrWIJevQM758q eTzd11Xu3jizwEvMvI95KWxHVF5pmKhQXA9TO899d9RkcmeLNvNg52HP/hkGgR8kT7Kskq x8+Z7V9qyQwp09GndrXJM3zVVcrAolw= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1736300430; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=e44YPIJX7mdgwR9QtS4wdSipveX6mt2j2rqrldUApVk=; b=hPygx2WnrdywNXabr11JBbqQp/wNM4/HczPbkZuN18thG7zwUNwV7NgcXIMtumZoqsoGazDtM/xLfXuC4/20IufUvO2DQ/iM2G+CwECi/fKiPMtNuv5RFZqhPkVNHg5Dz8nHpPloK/XTH1md3ZxBmG+/qIFsHSiV07ghE66rdf8= Received: from 30.221.145.29(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0WNBydP5_1736300427 cluster:ay36) by smtp.aliyun-inc.com; Wed, 08 Jan 2025 09:40:28 +0800 Message-ID: <4fb67211-d20f-4e36-b62b-2ef15c7aaef8@linux.alibaba.com> Date: Wed, 8 Jan 2025 09:40:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/5] mm/migrate: skip migrating folios under writeback with AS_WRITEBACK_INDETERMINATE mappings To: Miklos Szeredi , Shakeel Butt Cc: David Hildenbrand , Joanne Koong , Bernd Schubert , Zi Yan , linux-fsdevel@vger.kernel.org, josef@toxicpanda.com, linux-mm@kvack.org, kernel-team@meta.com, Matthew Wilcox , Oscar Salvador , Michal Hocko References: <0ed5241e-10af-43ee-baaf-87a5b4dc9694@redhat.com> <446704ab-434e-45ac-a062-45fef78815e4@redhat.com> Content-Language: en-US From: Jingbo Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Stat-Signature: jqspdh8k4p9f8t9fbt8iikjff8rdahb4 X-Rspamd-Queue-Id: 6B243100010 X-Rspam-User: X-HE-Tag: 1736300434-864686 X-HE-Meta: U2FsdGVkX18jBse9qpLK36UDqUQJmdAae6bG1wrM05uIB5mjA5fbArVkQiy9f0NwrpZb2bQOu+tpMJCKkhJIdlTfh3aXU27hcUoLObaszU1K99qYnzVOMQ/HMP+4mr6vG3BA4fnP102OwZ8OCy544SFmCZHxovRRCBZ6WYlmpbBdKjm+1qN2dijxIpwlE04G/NZabIrv2WNNC+VND0BKZ715J5TjIkEhTMgoPnkIUa7Mzh+6iQamJmygJLbngHNGNMl4zaJ7bUOkQt+YJUyW2v2vPFzydWjH6hiMXi3urgYwc8I59Ifs0JbVs9q2uWk72o/tb2SGrlEQpHHYJ6bxtEUO9ngiENrjhYCiKhbhNBVpAZ80WYG9GLq9UeV6D5ViicHtanJWlpKKlfWMViJ6Yj6vOFcdscFchA6fGKQG8ACs3PffeojL36ixpC10grs+U08Nopzt4Wy/ValWnDU+WSuWYAodLvuzhcDbzhv70+jxSfduiQ1zgubWvjgwow1Yf1rFIxm4KbTCVCRknERW75Bwp3VsUWhikU2pMU7ZQNSzpBNhFG80VvZaDYr95au15y8KGAinFEN1PKJ/QvG+ocXNDmvauNq3dTl3SQR9rMz8eryteKRe88PWTXf9kHeccsMhGLFKuVVaXG3v2kSZdVqywnbxu/k32tmSOJoAd7LQRz2LMprR9rfV5YB/YI4SF7+h4WWosQ3JtTP3R6tkjxnkBJ5fNkTkTw3kfPnw7QZevpQcE8HCpdt5EXtpDJpWJRA/mom0NjksVil2r7BicQGFNpsdSSi4jqJrX4AJ978/rKINYeKjgiepkgnn9xI9yDqs7n2bFj/zV5GViq9K+S5M+pY66LGOzLPnnVF+UF5ml+AdxXwmgo15iPLzv+iNp7BqKVBX7opYU/kmSFCBhplaQdH1aVgsghWJPFHODIcmrJCXbhS4aiS6g2Rl+bCez9x0Qj1GEYq3LzMcrWO ZBURDll4 UbbWB97UBwhfqDd/doIyG7bItKoND1KZsQEwmfqh2BuWFSp5HXv9nSrndK1wDt6aPOEURYTrJlJ1ppsYnc8D9+iv/ks1JkQJsQvVLujDtSn+zUFjM9Y1ER13IVdFAxF/DDKTwmi5cMIzkzl0MqDAbXTWkza3UQteIm73Pj4qHHp7bqflREmzJEKFJSJUAn3LjVWWcDvorlyUQ5Obdt7vMxGxV225Lb1tYtVa36XBgfdIZRrj5iftDfv3z46vppvjNVv06zVkkXAj8SqAP6KzJkwHq41uET5IKmoxQAKvSFY7QLkDpCgZN2AzrfglPb8YxRLjq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 1/8/25 12:15 AM, Miklos Szeredi wrote: > On Mon, 6 Jan 2025 at 19:17, Shakeel Butt wrote: >> >> On Mon, Jan 06, 2025 at 11:19:42AM +0100, Miklos Szeredi wrote: >>> On Fri, 3 Jan 2025 at 21:31, David Hildenbrand wrote: >>>> In any case, having movable pages be turned unmovable due to persistent >>>> writaback is something that must be fixed, not worked around. Likely a >>>> good topic for LSF/MM. >>> >>> Yes, this seems a good cross fs-mm topic. >>> >>> So the issue discussed here is that movable pages used for fuse >>> page-cache cause a problems when memory needs to be compacted. The >>> problem is either that >>> >>> - the page is skipped, leaving the physical memory block unmovable >>> >>> - the compaction is blocked for an unbounded time >>> >>> While the new AS_WRITEBACK_INDETERMINATE could potentially make things >>> worse, the same thing happens on readahead, since the new page can be >>> locked for an indeterminate amount of time, which can also block >>> compaction, right? >> >> Yes locked pages are unmovable. How much of these locked pages/folios >> can be caused by untrusted fuse server? > > A stuck server would quickly reach the background threshold at which > point everything stops. So my guess is that accidentally this won't > do much harm. > > Doing it deliberately (tuning max_background, starting multiple > servers) the number of pages that are permanently locked could be > basically unlimited. If "limiting the number of actually unmovable pages in a reasonable bound" is acceptable, maybe we could limit the maximum number of background requests that the whole unprivileged FUSE servers could achieve. BTW currently the writeback requests are not limited by max_background as the writeback routine allocates requests with "force == true". We had ever noticed that heavy writeback workload could starve other background requests (e.g. readahead), in which the readahead routine were waiting in fuse_get_req() forever until the writeback workload finished. -- Thanks, Jingbo