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 A1E57C6FD1D for ; Tue, 21 Mar 2023 11:37:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3D8A6B0075; Tue, 21 Mar 2023 07:37:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DC7936B0078; Tue, 21 Mar 2023 07:37:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB4C86B007B; Tue, 21 Mar 2023 07:37:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B9DF46B0075 for ; Tue, 21 Mar 2023 07:37:56 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8ECF5C1785 for ; Tue, 21 Mar 2023 11:37:56 +0000 (UTC) X-FDA: 80592706152.07.350A564 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by imf26.hostedemail.com (Postfix) with ESMTP id 706F0140009 for ; Tue, 21 Mar 2023 11:37:52 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf26.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679398675; 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; bh=VWP1PLKTI2r+yX19hxW8H7y+/dSMZS49+/FVmFaYE6s=; b=ii1Zu8msyKVraJ36x4cjrq3osFMKYFuCGjZuXi1vPk8DTyI+XCZpHk7pfZDsPDnnKsi3PE Cc0BQMLTtOO3ZBOeCUORv9e+rB4tH0cEJOxpyqGcqgE85GP/36APF7A8PUefW3Clv8zfqc v6VYvcrPxCMmAVSy/HctukDNJrtecPY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf26.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679398675; a=rsa-sha256; cv=none; b=ioF2CynxYLBwx9On520By5h+wPapq4F3ZxIIg8InZHubVY/mwEIcnkI2TiyBLDw8UG5r+C I+EPPMGW5mKfFSjU9Z1jfcFshzVjf2iReKqj2/y6vx6ZOiju8Pxx5bBpIEMB+sEKDNngh3 36EFdi2/JwtSDamUj+z9ywGRVKJ0uBo= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0VeMvco6_1679398665; Received: from 30.240.99.2(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0VeMvco6_1679398665) by smtp.aliyun-inc.com; Tue, 21 Mar 2023 19:37:46 +0800 Message-ID: <4102154a-1e49-54d9-b18f-c41da84e643e@linux.alibaba.com> Date: Tue, 21 Mar 2023 19:37:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 0/6] tmpfs: add the option to disable swap To: Luis Chamberlain Cc: hughd@google.com, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, linux-mm@kvack.org, p.raghav@samsung.com, da.gomez@samsung.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230309230545.2930737-1-mcgrof@kernel.org> From: haoxin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 706F0140009 X-Stat-Signature: k7sd7oa779bcp6x6b5bfnth1qtry3bg3 X-HE-Tag: 1679398672-121001 X-HE-Meta: U2FsdGVkX1/6H5YszEZfoh98Oa1REyeAOVp4TjkvLtL19Pez5UpN4v4Q/d5tkmznoln8PRJpUr+ncoY+p6zPySG32m4jigfetoEK4gd7Ytv8P5TbhhwFAcnhFbQdjV/qlWSyfTA0jX6smWKe/EbroroHMluiSCMm/GxYUL0rVExaZKL6PGK97zXXVSMRdWzd5xxUkpEnu/hq3Y7RX9u9utD+1SfhZ+sf5g/DaSi6f0RWitN1sCsw95Mvw6uZZBXPbrGJfm8vDxONX/ERXQwMPOYqL4m6BBg5C+s2rWO8mv/+CCaBNdevdjP80F7G+huTPFxHdxvGdxrZoI3dq8KkTzzk2iQkGVCZ5UBXzY2hUERBJsoi0Mq6Q2hhkkKa6Z0GQEYlBdpztvq0OSMEKEXyO5cbd7Ci8INhCUx0PPF43SkQf2IT/2j1m2UVkreZQ6dJL9CGi3wg38hRZPROL1AHScByssL4/IuG55AyLeK5mGpnReGEXQI/hdmsP3IdLKicYdUoARKsWezBaJ1KF4D27gs0q/22LX6bNFtwk0ayDkFkA+BcOSog68h8WmhesBA0ZU4UPHubr7xtOBFey71PoASrhmZyOCEDW2TqeVUmLhThPqyb5MYZWO3X91mF1Gj4yo+cEkrOPYBTr2T9rl+C7/35Oa913BsY6Li++WuujqFNGy+KJRZ2jYQA8jWe4V6f0NtUOOXX9gFCnAeXe3flvECotbc0DoPwQiVkkKtxsS47jTA3ACapOdbrZtcZ3Q25qeiCyaNN2MUTb1P6/azMz7zV/magaK44GMsX639LD9QVYN+UALzz3dmTvNOKx0hZ/ct1gqa7/Y3QC6qWxlAqOgbiF70XD9PrAnDzn6DfvalYRjFGn31lFHooqnwqU8qigCoRh52bJUjmKC7NXxhKYDn0PHLi90YBpJDVqYzdRJbFM2qMB8/6ZfIPXUDH1CQ/xcEiLJcV1/yiU98jgMY qqUX7i9d rRpBz1XFh2pw3UAXSCebb2Cor72by4FgtvBRve1dKhTxhJqCZBNtpmZ6DxjIuYPlWCcZi0AhR54mSZJuwXZ1+cGKWkMluATWJP2fiUC7XKioExOPF0h06nVhf7t/SygxumWXx 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: 在 2023/3/21 上午5:36, Luis Chamberlain 写道: > On Mon, Mar 20, 2023 at 07:14:22PM +0800, haoxin wrote: >> 在 2023/3/20 上午4:32, Luis Chamberlain 写道: >>> On Tue, Mar 14, 2023 at 10:46:28AM +0800, haoxin wrote: >>>> All these series looks good to me and i do some test on my virtual machine >>>> it works well. >>>> >>>> so please add Tested-by: Xin Hao . >>>> >>>> just one question, if tmpfs pagecache occupies a large amount of memory, how >>>> can we ensure successful memory reclamation in case of memory shortage? >>> If you're disabling swap then you know the only thing you can do is >>> unmount if you want to help the VM, otherwise the pressure is just >>> greater for the VM. >> Un, what i mean is can we add a priority so that this type of pagecache is >> reclaimed last ? > That seems to be a classifier request for something much less aggressive > than mapping_set_unevictable(). My patches *prior* to using mapping_set_unevictable() > are I think closer to what it seems you want, but as noted before by > folks, that also puts unecessary stress on the VM because just fail > reclaim on our writepage(). > >> Instead of just setting the parameter noswap to make it unreclaimed, because >> if such pagecache which occupy big part of memory which can not be >> reclaimed, it will cause OOM. > You can't simultaneously retain possession of a cake and eat it, too, > once you eat it, its gone and noswap eats the cake because of the > suggestion / decision to follow through with mapping_set_unevictable(). > > It sounds like you want to make mapping_set_unevictable() optional and > deal with the possible stress incurred writepage() failing? Yes, Just a personal idea, in any way, the current patch is an excellent implementation,  thank you very much. > Not quite > sure what else to recommend here. > > Luis