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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C549CDB47E for ; Thu, 19 Oct 2023 02:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbjJSCRI (ORCPT ); Wed, 18 Oct 2023 22:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbjJSCRH (ORCPT ); Wed, 18 Oct 2023 22:17:07 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D2D99B for ; Wed, 18 Oct 2023 19:17:06 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S9rnt6YvbzvQ0V; Thu, 19 Oct 2023 10:12:18 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 19 Oct 2023 10:17:04 +0800 Message-ID: <22acc5a1-39a7-4a44-b468-429f1ca23b5c@huawei.com> Date: Thu, 19 Oct 2023 10:17:03 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] mm/khugepaged: Convert collapse_pte_mapped_thp() to use folios Content-Language: en-US To: Vishal Moola , CC: , , References: <20231018203213.50224-1-vishal.moola@gmail.com> <20231018203213.50224-6-vishal.moola@gmail.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/10/19 7:01, Vishal Moola wrote: > On Wed, Oct 18, 2023 at 01:32:13PM -0700, Vishal Moola (Oracle) wrote: >> This removes 2 calls to compound_head() and helps convert khugepaged to >> use folios throughout. >> >> Previously, if the address passed to collapse_pte_mapped_thp() >> corresponded to a tail page, the scan would fail immediately. Using >> filemap_lock_folio() we can get the corresponding folio back and try to >> operate on the folio instead. >> >> Signed-off-by: Vishal Moola (Oracle) > > Hi Andrew, I've attached a fix patch addressing the syzbot issue. > It can be squashed into this patch, syzbot tested it on v2 already as > well. Hi Vishal, only IS_ERR(folio) is enough since filemap_lock_folio won't return NULL.