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 D0DB8C433FE for ; Tue, 24 May 2022 10:56:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0AE7D8D0005; Tue, 24 May 2022 06:56:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05DA28D0002; Tue, 24 May 2022 06:56:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB4688D0005; Tue, 24 May 2022 06:56:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DF8A58D0002 for ; Tue, 24 May 2022 06:56:44 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B937E210AF for ; Tue, 24 May 2022 10:56:44 +0000 (UTC) X-FDA: 79500333528.02.BB6C012 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf17.hostedemail.com (Postfix) with ESMTP id B919840024 for ; Tue, 24 May 2022 10:56:14 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L6rjd50SgzDqLZ; Tue, 24 May 2022 18:56:37 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 24 May 2022 18:56:39 +0800 Subject: Re: [PATCH v4 4/5] mm/shmem: fix infinite loop when swap in shmem error at swapoff time To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: "akpm@linux-foundation.org" , "hughd@google.com" , "willy@infradead.org" , "vbabka@suse.cz" , "dhowells@redhat.com" , "neilb@suse.de" , "apopple@nvidia.com" , "david@redhat.com" , "surenb@google.com" , "peterx@redhat.com" , "rcampbell@nvidia.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" References: <20220519125030.21486-1-linmiaohe@huawei.com> <20220519125030.21486-5-linmiaohe@huawei.com> <20220520063433.GA584983@hori.linux.bs1.fc.nec.co.jp> <970aee34-c377-2b8c-c6bb-45e2a96e84b9@huawei.com> <20220522235326.GA713751@hori.linux.bs1.fc.nec.co.jp> <7269c0c4-7648-a9dc-10fa-3645da5be441@huawei.com> <139b521b-f477-d108-79ed-4ea2bd76bdf3@huawei.com> <20220524064416.GB774480@hori.linux.bs1.fc.nec.co.jp> From: Miaohe Lin Message-ID: Date: Tue, 24 May 2022 18:56:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220524064416.GB774480@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: B919840024 X-Stat-Signature: 5u1fbb7pk9bgcdupsyeoycerdd6kawuj X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1653389774-343943 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 2022/5/24 14:44, HORIGUCHI NAOYA(堀口 直也) wrote: > On Mon, May 23, 2022 at 07:23:53PM +0800, Miaohe Lin wrote: > ... >>> >>> I reproduced the deadloop issues when swapin error occurs at swapoff time in my linux-next-next-20220520 env, >>> and I found this patch could solve the issue now with the fix in my another email. >>> >>> BTW: When I use dm-dust to inject the swapin IO error, I don't see non-uptodate folio when shmem_swapin_folio >>> and swapoff succeeds. There might be some issues around that module (so I resort to the another way to inject >>> the swapin error), but the patch itself works anyway. ;) >> >> Sorry, the reason I don't see non-uptodate folio when shmem_swapin_folio is that all the shmem pages are still >> in the swapcache. They're not read from disk so there is no really IO error. :) When they're indeed freed, the >> deadloop issue occurs. >> >> I am thinking about extending the function of MADV_PAGEOUT to free the swapcache page. The page resides in the >> swapcache does not save the system memory anyway. And this could help test the swapin behavior. But I'm not >> sure whether it's needed. > > The extension make MADV_PAGEOUT free swapcaches makes sense to me, > so I'll support it if the original implementer agrees the change. I'd like trying to do it when I have time. :) Thanks! > > Thanks, > Naoya Horiguchi >