Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5781233rwl; Tue, 4 Apr 2023 03:39:24 -0700 (PDT) X-Google-Smtp-Source: AKy350b6p2LQzurad6lQEagT1brBBlYCdW5pK+eKchc141DgU6vuKOVxZohSOFi9SA+jOzOJEP73 X-Received: by 2002:a17:907:d30d:b0:8ae:e724:ea15 with SMTP id vg13-20020a170907d30d00b008aee724ea15mr2488717ejc.76.1680604764614; Tue, 04 Apr 2023 03:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680604764; cv=none; d=google.com; s=arc-20160816; b=Imoj1gNUCEQssYazfbyWqPFqXAP5gHKkUdB09OEYiQwgM4gKhj5Plhsm1qwU8gI/A0 aUdzsu9ujTpThu/5as64IvVqQHHD75uC0NuU2RxFt2kkrK3KcAwiNZauEMBztLXyrIY4 O0w7VAZ0ZTaKK6Y19ujrFmm3OEyE4HFmX2tMqgv87eCRwVW8v7+ZPbmJzBJwbyCNiDq4 jHROVoQAB7s/zfldcV9f714dx00zYgnM+2RFoeNPFf8r2Hrw4gXtfsVO66e9veTCu0ds z6nyWaVxSKqadxr4A5TLgmhwGOmQTQqId1Zl4TVhjCjO6tio1XPwpQCiWaLreZt6i3CK 0TkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=BppM7GftMObA2NSPlHnsHlni92IKzhtfwR96UZGSeZo=; b=C45ZNb+ra5CN0zIWXHub12BUs4UALcATROXA6qQrsRcUc0HLKqKtt+hhM7841E06gf U8U5GkEabLlytK3rSO1J81pUBIbjFCgAakEemNBp1fsL6zcEWFy28RWeo62oZ9QOBobE /ZbFS3Zm//XYhadJRBFqHuL0O0WgG6adZ1e7vNqO8GFff8ahDxOxyD9T/jQfxaZ5iT/r 3/bALuyr98Cby3oRtFilJ1hG10cm1DLmVc/BQNWFJLWuGoWFlWA5Bcd9Q5lkNYOw1OCe /BTFBZ7frh1FueBonWSAZQQtFUnGxE7SEbHlidGtRgOapfoi2+Gs3oaGV9V8RojCC8Dl DNfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rq9-20020a17090788c900b00947ad578e52si1595799ejc.906.2023.04.04.03.38.51; Tue, 04 Apr 2023 03:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234314AbjDDKgP (ORCPT + 99 others); Tue, 4 Apr 2023 06:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234009AbjDDKgO (ORCPT ); Tue, 4 Apr 2023 06:36:14 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E58210B for ; Tue, 4 Apr 2023 03:36:12 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PrPGG6Ll9zSn8d; Tue, 4 Apr 2023 18:32:22 +0800 (CST) Received: from [10.174.177.229] (10.174.177.229) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 4 Apr 2023 18:36:06 +0800 Message-ID: <9cdeeacd-8a64-cf73-7054-fcb58c3705ac@huawei.com> Date: Tue, 4 Apr 2023 18:36:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH 1/2] mm: memory-failure: Refactor add_to_kill() To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: "akpm@linux-foundation.org" , "linmiaohe@huawei.com" , "wangkefeng.wang@huawei.com" , "sunnanyong@huawei.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" References: <20230330074501.205092-1-xialonglong1@huawei.com> <20230330074501.205092-2-xialonglong1@huawei.com> <20230331054142.GA1435482@hori.linux.bs1.fc.nec.co.jp> From: xialonglong In-Reply-To: <20230331054142.GA1435482@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.229] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your response. I will modify the name of this parameter to "ksm_addr" in the next version. Best regards, Longlong Xia 在 2023/3/31 13:41, HORIGUCHI NAOYA(堀口 直也) 写道: > On Thu, Mar 30, 2023 at 03:45:00PM +0800, Longlong Xia wrote: >> The page_address_in_vma() is used to find the user virtual address of page >> in add_to_kill(), but it doesn't support ksm due to the ksm page->index >> unusable, add an addr as parameter to add_to_kill(), let's the caller to >> pass it, also rename the function to __add_to_kill(), and adding >> add_to_kill_anon_file() for handling anonymous pages and file pages, >> adding add_to_kill_fsdax() for handling fsdax pages. >> >> Signed-off-by: Longlong Xia >> --- >> mm/memory-failure.c | 29 +++++++++++++++++++++-------- >> 1 file changed, 21 insertions(+), 8 deletions(-) >> >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >> index a1ede7bdce95e..9ca058f659121 100644 >> --- a/mm/memory-failure.c >> +++ b/mm/memory-failure.c >> @@ -405,9 +405,9 @@ static unsigned long dev_pagemap_mapping_shift(struct vm_area_struct *vma, >> * page->mapping are sufficient for mapping the page back to its >> * corresponding user virtual address. >> */ >> -static void add_to_kill(struct task_struct *tsk, struct page *p, >> - pgoff_t fsdax_pgoff, struct vm_area_struct *vma, >> - struct list_head *to_kill) >> +static void __add_to_kill(struct task_struct *tsk, struct page *p, >> + struct vm_area_struct *vma, struct list_head *to_kill, >> + unsigned long addr, pgoff_t fsdax_pgoff) > > Hi, Longlong, > > The new argument addr seems to be used only from add_to_kill_ksm(), > so you can name the argument as such (like ksm_addr), as we do > for fsdax_pgoff (which is clear to be used only for fsdax)? > > Thanks, > Naoya Horiguchi