Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37280929rwd; Tue, 11 Jul 2023 11:59:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlEW4Wf9L65poNaZZbS/F2AqMn7yXdoZhsOPCJZdzc90vxNECMRTac1brdegYt+5euDlQYH4 X-Received: by 2002:a05:6402:1914:b0:51d:cf7b:c9f0 with SMTP id e20-20020a056402191400b0051dcf7bc9f0mr27684761edz.12.1689101968798; Tue, 11 Jul 2023 11:59:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689101968; cv=pass; d=google.com; s=arc-20160816; b=UOLvQd2W2ijIJyGTrVaGhrWzq5XBeARIvbPWjj3Eva0UKmwu2eF3v8Ft9RvCA/DAGT bxnoTK68F/bdvvG06dBiqPq+RfATy5yajSP7VCPRQIEcLCWnrtMuVa3NzTYI3CDHzjlR rFOIxY4GfTJ1OB+RXltMgqeHqEi8vSTOUGEfy6hdlTad10OZiBxW1SP8hixnQAbldlM8 bwHRamcdCXYVqdMeTVW4Ap97XtUCehPnDpDEoN0oZSaNusCZuEHgIGE0mjozGc76Lr/g fjw8hKOY3keHX4BdiTrCVcdAViK6jeZhpl4WXftjMNqVN93rBxUnRcZ+7qEF02w1cHP6 ueeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=g0i9PFi54CJqwF/Ht3S6gsgCdE5C9kBkDs20oqDF6CE=; fh=lx6Frp8uNfm2Sxlp/eK7JLeiUZB+rBzdBW5BTc9DYLI=; b=vHac691fk41QzbwfaMM1kTkl40Ju6VwnrUHHa5aGOzvrRL1eyfg2QbhBb/QMllzk6q O47X6exXB2JjQFl6Y/4S7yKsv2YfKhAogQooEPq/Op/zvqFbJ2K0/B2+aPtut6FhU/rr Ic9Is36Na6cFfDsyCOomsGTOsClFmjysyZDM1X8INEaZiB7tfWD3VV+91byyYU9bPbyE PycfOeyjv3M2T+xa8cv6nzm3qhFIXYkzIOEcah+LV+EFVC3NcC/cZ1T24V69iX/QQN2s DSxMtTqZHnBS+aEKTLYUjKKtnqjl/7QdolMyYzM65qjuAVXzD2bpqPiy4/A5lH5/26Cs fM7Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=uV0dDwlL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=r+YaAsz2; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a05640208c500b0051e00748772si2658304edz.619.2023.07.11.11.59.04; Tue, 11 Jul 2023 11:59:28 -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; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=uV0dDwlL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=r+YaAsz2; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbjGKSCr (ORCPT + 99 others); Tue, 11 Jul 2023 14:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjGKSCq (ORCPT ); Tue, 11 Jul 2023 14:02:46 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B60810EA for ; Tue, 11 Jul 2023 11:02:45 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36BG3qsa023594; Tue, 11 Jul 2023 18:02:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : content-transfer-encoding : in-reply-to : mime-version; s=corp-2023-03-30; bh=g0i9PFi54CJqwF/Ht3S6gsgCdE5C9kBkDs20oqDF6CE=; b=uV0dDwlLp/4i0i95n7Lj53DALJ09dbXoG+p3wXmyGY8htYBGgO+3TeB5mPc5XynwEO+9 jp1NaRXT64znziyrKz9duldIzt5sKtVATAS194xBwyxEAy71TGV7BcPljVu5U0WmS8tV 8QjxaguDZKZ2xaq5nSq2IJEU3G9IjtI83Dbneh42xoJLz0ZPja77QNw91C6TkzadqnQP itOG+JEbXJEat9tXOI/ZN9ZwKN1+o92M4SVf7NTdHrzqrphzdV2m8OP0PL2wJtk+iT8b 9cq5cw5Vizai32T9+JEj04GX92Eef1YDsPz8GlFSKRBXJgn8GhTsSbSGQcR5dF3fDWob Ig== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rpyud5mvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jul 2023 18:02:05 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36BGUcKP008358; Tue, 11 Jul 2023 18:02:05 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx8bgvae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jul 2023 18:02:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BCQfQ82XdSE5idVM8ZgpTi/VMafARLdcAOg7uKUWq2jpFpNfOQ1OEO2LbtBFDHiirvNj8Y2pDKw8CdamXoFIZRBLASS3VXjZhu8bcySpmF3YiImAoEq2e03lQ0sKafpGHT1AR2kFWMvFkFZRiN0CZfofPLCF2mE3JjTh/OFwWhdqYtHokn4hwa93+R/wRiPQhnnu2MbmuZkz9M65GD8ipgXIHeqskgr+h80TyjiHJRBlwn6+zBBWaH18SRmoofVmjrPkaq0f4WPIB35fKGPgethZ0WHH4RZLuduQ2MVZPmsuqTeiH9T+H1fLWK0AThzheffbJ8vVjddwUO7RqP9txg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g0i9PFi54CJqwF/Ht3S6gsgCdE5C9kBkDs20oqDF6CE=; b=DbJoroL5rDdLWK4Ly6tGLQoVU3R0u/3iCw5XNTClZ8a0i6isV95NVgdPR9ziOxaSIZ9IYeOziuYKyq63UlDVHvw7S6MxA2+SpX4Bx69WcjPh9rX+3+a3BpVTq4OeDMwhzqIFUkEhsxo1Jd0uDVvnVvHQNI0VUZh0a0S/oEJxLOE7xdw4jhRJmAK27g35ZJ6drPs3GjA0eR/ymThAcZE07NSzhGsz+mr7jxrtVrDuKD5rjSAWUs4mHnxdlTP8wM0C9LJBHqK0Sb3m3ONBNiArZM5Vkar+y0yGr6bhzRUVkPWRaIsDiMF6yZ7ilHYua4iXSUtkK+ihMTnpvNjSdX+a8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0i9PFi54CJqwF/Ht3S6gsgCdE5C9kBkDs20oqDF6CE=; b=r+YaAsz22Fg3FERaypIVKVlAdu06QjR0xztUOni4WlKHJcAeTtP4XHzccKhisE6TLETvu4bVdlVLbBhluDaMVBQLyvNGsNGCoI0q7Vkt8l3yWmmAzfc4xE+CMd1jG4uGpP6EKVKhGEcCknju0Z26NVpTCu4YWX5heR1j2o5vGYQ= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by DS0PR10MB7176.namprd10.prod.outlook.com (2603:10b6:8:f1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Tue, 11 Jul 2023 18:02:03 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::4a17:13b0:2876:97f2]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::4a17:13b0:2876:97f2%7]) with mapi id 15.20.6588.017; Tue, 11 Jul 2023 18:02:03 +0000 Date: Tue, 11 Jul 2023 11:01:59 -0700 From: Mike Kravetz To: Jiaqi Yan Cc: Miaohe Lin , akpm@linux-foundation.org, naoya.horiguchi@nec.com, songmuchun@bytedance.com, shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duenwen@google.com, axelrasmussen@google.com, jthoughton@google.com Subject: Re: [PATCH v3 2/4] mm/hwpoison: check if a subpage of a hugetlb folio is raw HWPOISON Message-ID: <20230711180159.GA3887@monkey> References: <20230707201904.953262-1-jiaqiyan@google.com> <20230707201904.953262-3-jiaqiyan@google.com> <6682284d-7ad3-9b59-687d-899f4d08d911@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: MW4PR03CA0294.namprd03.prod.outlook.com (2603:10b6:303:b5::29) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|DS0PR10MB7176:EE_ X-MS-Office365-Filtering-Correlation-Id: 22dd528c-9558-4b5e-1aaf-08db8238eddb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I3lIX9dE6Cn8qNiTTmYtpaGUAZRJnnDdc1V4YHRpx2DPISoRTrjesQJWwQaNobwzLISe0tIgTZqt1ns8QqiNHOglnUKpBTIRde207DysS+kcv4P2iFRmoANebVrRoFsB3rwUu4Pr+XDB3fnTEh5qBHD7pg4ukqIgR5XBkLwWJmyC4LAUC2Ts1Xx20+80/vlxLEtpKe6qwk/wZASoN9xwwdR20SVftNv5cYbgaAhhroZrhB/iQC8yYnPOZMjXdUKKTu6oqarKcELiXG6gbIDl+O/W9gGJX9xivKLIxzTnF2GayTOmIiUDskqH7QPPgoqMTfOESgEe41osVXjVlcS8JqzGw3cpRtIdO3xu+VJqc5q/AbSe6zWPqCrDTfLHsSmeYUD2C5WwaGFgcYxmsY7vSH4/Qo9s2w1+5pPMPCWx8UReYiJsdhccpj8/vuI+Z8WdIiKiMpRNvZNFOCiBho/TLLDHLSubF4QWG7ZajrBJfQm2dXvMoSyJMfhxeGcP1rFV/wUCzPquHQVKc0XIWkC5qUBHc7EuxoiG2o+MSp4LWFKhj6VTvJujYUrjCIZiyhm4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(346002)(39860400002)(366004)(136003)(396003)(376002)(451199021)(186003)(1076003)(53546011)(44832011)(6506007)(8936002)(8676002)(26005)(33716001)(7416002)(5660300002)(6486002)(41300700001)(86362001)(316002)(2906002)(83380400001)(6916009)(4326008)(66946007)(66556008)(66476007)(6512007)(38100700002)(9686003)(33656002)(6666004)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SFNteFl5V0w5TmtYazh6ZmkrOWdSb0pVbDE5Sk0xZDNjck1TUlRIVllzYWR1?= =?utf-8?B?aCsyK0M1eUFIeC9GOHh5ZDhScjkvZ200VjJFVWJubUorMG1PQU5GT0MzMzNV?= =?utf-8?B?d0drQ1RMUi84T1BJT3NYcEFLcXRsL0xiY3FocHU1aGNkSHN1bXBwNnR3cGQv?= =?utf-8?B?d2U1emg5Q2FUM29kQ3F2RW1TQTdObFh6ZnFRRnQzTTN5aTd0MDZVa0IzTEFh?= =?utf-8?B?aFZSbnRwUHp3T04vbnRNc2VTZVlaZlA0TENIRFBEUytLeG41RG4rK1locE5n?= =?utf-8?B?S1QzWCtpVDgybERkOTRxeWt4UitDcXpiV0xZTFBIU3FsamlKWmJ5VjR6VEpm?= =?utf-8?B?cEpqNW9FQmoxZlZNUCszT3g3NmkxZGNYRzNiZlg5dkphWFNhUkZOVFJFRnhU?= =?utf-8?B?eXR0Sm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1czQvcUFobnVP?= =?utf-8?B?ZEdHbGRvNGVFalJHK0pBTWUyMkkxelV2eEtTdzRveXA0MUFoTkIvZ2dGSWE1?= =?utf-8?B?WGNkTFdQTjVBR1Y3LytuaUtYL05WTE1BaTFFSG1mUGRsOWRrdFdqSy9VZ2Vz?= =?utf-8?B?ZHBvYm9UMS9EeWozenIrSmRjYUZJK2NmOGFCcGhHTmZuN2NlN1NZU1hJVE5h?= =?utf-8?B?d09KLzJpOGtPV2VzY2xqRCt0dEZ5cmZyWTN4aXN2WXpuVFMrRUVYNjlEQjhw?= =?utf-8?B?QWMyQUtwYnFhN3RyVE5QQjdWWEozM1YzQnA2NG1oN0F4bnJMdHdidHBOQURv?= =?utf-8?B?d1RqcExra0w4a1h2aGJBU3lMRjRaRWtrTjBEcVFJL0E0SEs5Tm9KMGwwYjNu?= =?utf-8?B?QkJMam5pcVdEV3MzQ2pHMjlHWFpwQlMwalE5Skk3Yzl1dDZxd0swQXBUZEgv?= =?utf-8?Q?Mt5AB9ZnS9Wx8=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22dd528c-9558-4b5e-1aaf-08db8238eddb X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 18:02:02.8263 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Cmcv83GtTuUJ7t1kkXGExloU2jp5iz6E1babRzIMiZ8fWPbIjZlYHlcSHyjAP259os8Ox1MAMs4kS+liMQLAvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7176 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-11_10,2023-07-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=621 adultscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307110162 X-Proofpoint-ORIG-GUID: VuyzfKHWbLecGdWNe3foHnvtX9xYU0Tr X-Proofpoint-GUID: VuyzfKHWbLecGdWNe3foHnvtX9xYU0Tr X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 07/11/23 10:05, Jiaqi Yan wrote: > On Mon, Jul 10, 2023 at 8:16 AM Jiaqi Yan wrote: > > On Fri, Jul 7, 2023 at 7:57 PM Miaohe Lin wrote: > > > On 2023/7/8 4:19, Jiaqi Yan wrote: > > > > > > > + if (subpage == p->page) { > > > > + ret = true; > > > > + break; > > > > + } > > > > + } > > > > + > > > > + return ret; > > > > } > > > > > > It seems there's a race between __is_raw_hwp_subpage and unpoison_memory: > > > unpoison_memory __is_raw_hwp_subpage > > > if (!folio_test_hwpoison(folio)) -- hwpoison is set > > > folio_free_raw_hwp llist_for_each_entry_safe raw_hwp_list > > > llist_del_all .. > > > folio_test_clear_hwpoison > > > > > > > Thanks Miaohe for raising this concern. > > > > > But __is_raw_hwp_subpage is used in hugetlbfs, unpoison_memory couldn't reach here because there's a > > > folio_mapping == NULL check before folio_free_raw_hwp. > > > > I agree. But in near future I do want to make __is_raw_hwp_subpage > > work for shared-mapping hugetlb, so it would be nice to work with > > unpoison_memory. It doesn't seem to me that holding mf_mutex in > > __is_raw_hwp_subpage is nice or even absolutely correct. Let me think > > if I can come up with something in v4. > > At my 2nd thought, if __is_raw_hwp_subpage simply takes mf_mutex > before llist_for_each_entry, it will introduce a deadlock: > > unpoison_memory __is_raw_hwp_subpage > held mf_mutex held hugetlb_lock > get_hwpoison_hugetlb_folio attempts mf_mutex > attempts hugetlb lock > > Not for this patch series, but for future, is it a good idea to make > mf_mutex available to hugetlb code? Then enforce the order of locking > to be mf_mutex first, hugetlb_lock second? I believe this is the > current locking pattern / order for try_memory_failure_hugetlb. I think only holding mf_mutex in __is_raw_hwp_subpage would be sufficient to prevent races with unpoison_memory. memory failure code needs to take both mf_mutex and hugetlb_lock. The hugetlb lock is to prevent hugetlb page state changes. IIUC, __is_raw_hwp_subpage is only taking hugetlb_lock to prevent races with memory failure code. Of course, I could be missing something as there are subtle issues with locking in the memory failure code. -- Mike Kravetz