From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DF2229428; Fri, 7 Jun 2024 04:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717735119; cv=none; b=oG+gQ5mf3eyjquevM1zyVsiczt83rUECQJNm4OSN1L+GnenVrh+RH7QjoWuycDQDO1le/CYBZZffwpuk2+gcQt0KuIIj4h/kcMNbxda89wUon6JashI/zVVyOS9Rdycaxit8Ljh0U8SYrsg5aNq/UfI4hmfk1ZJd/SN2v4LYttw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717735119; c=relaxed/simple; bh=vac7htRjP7+xLahxrQT74cj20v7bpo9RsBX5+L4ZlqE=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=EskVON8td0aiPAZeUDFuSyoG8a0MP5C1vUN+z2KBypDbUuYr3rOJbukfAOZnckjGW5FHrjMx8Z+nRJCAwTWjIn5/v5gEm5p35SDQP/s6TsYzKRPc3fRn/sKDLxAKoSm8LqS+sPoKTdKT0GwRqB/CCRB6lXT/kud6jwzN7xTXkns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VwSyy4JZBzwRv6; Fri, 7 Jun 2024 12:34:34 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 873A618007E; Fri, 7 Jun 2024 12:38:33 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 7 Jun 2024 12:38:33 +0800 Message-ID: <20253c7b-fdf9-47db-a388-ab34b8658a2a@huawei.com> Date: Fri, 7 Jun 2024 12:38:32 +0800 Precedence: bulk X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/13] mm/memory-failure: simplify put_ref_page() Content-Language: en-US To: Miaohe Lin CC: , , , , , , References: <20240606063247.712575-1-linmiaohe@huawei.com> <20240606063247.712575-2-linmiaohe@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) On 2024/6/7 11:28, Miaohe Lin wrote: > On 2024/6/6 14:46, Kefeng Wang wrote: >> >> >> On 2024/6/6 14:32, Miaohe Lin wrote: >>> Remove unneeded page != NULL check. pfn_to_page() won't return NULL. >>> No functional change intended. >>> >>> Signed-off-by: Miaohe Lin >>> --- >>>   mm/memory-failure.c | 6 +----- >>>   1 file changed, 1 insertion(+), 5 deletions(-) >>> >>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >>> index f679b579d45d..2e6038c73119 100644 >>> --- a/mm/memory-failure.c >>> +++ b/mm/memory-failure.c >>> @@ -2120,14 +2120,10 @@ static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) >>>   /* Drop the extra refcount in case we come from madvise() */ >>>   static void put_ref_page(unsigned long pfn, int flags) >> >> Since all calllers have a valid page,better to pass the page instead of pfn? > > Seems not. put_ref_page() called above memory_failure_dev_pagemap() seems don't have a valid page yet. > Also page might be NULL when calling put_ref_page() in soft_offline_page(). So it should be better to > still pass pfn. Or am I miss something? Yes, missing it, please ignore it > > Thanks. > . >