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 50845ECAAD2 for ; Fri, 26 Aug 2022 07:52:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A03C7940008; Fri, 26 Aug 2022 03:52:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B3BE940007; Fri, 26 Aug 2022 03:52:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 853E2940008; Fri, 26 Aug 2022 03:52:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 759B6940007 for ; Fri, 26 Aug 2022 03:52:45 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C3DC81C674C for ; Fri, 26 Aug 2022 07:52:44 +0000 (UTC) X-FDA: 79840977048.15.203C13B Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf14.hostedemail.com (Postfix) with ESMTP id 4976210000A for ; Fri, 26 Aug 2022 07:52:44 +0000 (UTC) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27Q4fDYu010624; Fri, 26 Aug 2022 07:52:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=2r67fnxG1d/G01C83dTecSDL8ltCIpH6BkdTqoYwbJs=; b=cQvtsIA4Z+pR1JhNaIVjqMZ9CvYi6PI/RqHBHUNOWnVF0lIgIi3xVI8osFW2RTWf6IuK mO+ixTtS8adeoYT1zKe+TkFKODEruDvPXVGo6pp5KqveDsMdfWwM/J/+X5V6SnWup9IW WALlDaUhz6AX4unpjLZasIFuT8io0nDVuUNs/WGA4ia4Iw8gm8E+76wJYGuf2sUmR6sp tlMbN/U77VBWApA17ixwHAKVv9GTTWhqOiyu94OtU3vZBbt2kjAFn/jS6JBu/wQCu7Rp Ateoo+UcEA+wMNiDuOai5pZ/z84HOscgzyjPu3P2nzqkVsYUlbHeZ/JpflIlvpoeHj4i OA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3j64h7mk50-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 07:52:38 +0000 Received: from pps.filterd (NALASPPMTA01.qualcomm.com [127.0.0.1]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 27Q7qbv2024922; Fri, 26 Aug 2022 07:52:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA01.qualcomm.com (PPS) with ESMTPS id 3j6g9j1x72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 07:52:37 +0000 Received: from NALASPPMTA01.qualcomm.com (NALASPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27Q7qbJL024917; Fri, 26 Aug 2022 07:52:37 GMT Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (PPS) with ESMTPS id 27Q7qawV024915 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 07:52:37 +0000 Received: from [10.216.48.161] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 26 Aug 2022 00:52:32 -0700 Message-ID: Date: Fri, 26 Aug 2022 13:22:29 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH V4] mm: fix use-after free of page_ext after race with memory-offline Content-Language: en-US From: Charan Teja Kalla To: David Hildenbrand , , , , , , , , , , , CC: , References: <1660830600-9068-1-git-send-email-quic_charante@quicinc.com> <01fd2b11-513d-eb91-5ce6-fcaa198f8d28@redhat.com> <113fd59f-e4c0-4ee1-4196-6c926677947c@quicinc.com> In-Reply-To: <113fd59f-e4c0-4ee1-4196-6c926677947c@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: oyOIePZPgahvipBwNzl_jEUG7-iQUkKV X-Proofpoint-GUID: oyOIePZPgahvipBwNzl_jEUG7-iQUkKV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-26_02,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=561 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208260028 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661500364; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2r67fnxG1d/G01C83dTecSDL8ltCIpH6BkdTqoYwbJs=; b=EOulcwP7fzR3+SLgqUlCNzhhjXxVreclnPcgqbhmN0zd2fdg/DAOZSQcUD0s9De1hinpdH Nq/ZUrKOZDsb5+wCHifd42mIruzDlYjZvD9BRMiUo+xGgXqhd8biSfqO/aqk06vYzR/Lml 9pEGSVTRzc5hWb52a6pyFrk9XtxSwSE= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=cQvtsIA4; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf14.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661500364; a=rsa-sha256; cv=none; b=DLEfI6ymVXANkSMCyDOhGTh96Radp4wSx0cs0bWQMlwe3Ipwb9yyxX128VzbxuaF/SZp3S hTNGOdTOLHjGPnttxPW92U4byYk1pWTIyaq4pzpuw5UBD6RTep1ZJizQk9wzPE1zKFTpBD rJlKIlI9pj4dNdxZCf/OSpLnkADhYMk= Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=cQvtsIA4; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf14.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com X-Rspam-User: X-Rspamd-Queue-Id: 4976210000A X-Rspamd-Server: rspam10 X-Stat-Signature: kuwji17wyfry4ujwfo8rg94kcxzo8hmo X-HE-Tag: 1661500364-236003 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: Hi David, On 8/23/2022 10:35 PM, Charan Teja Kalla wrote: >> I kind-of dislike the "loop" labels. Can we come up with a more >> expressive name? >> >> "put_continue" >> >> or something? >> >> >> One alternative would be to add to the beginning of the loop, and after >> the loop sth like >> >> if (page_ext) { >> page_ext_put(page_ext); >> page_ext = NULL; >> } > I think, moving this to beginning of the loop looks cleaner than the > goto statement. Will spin V5. > I have realized that goto looks simpler and cleaner... Raised V5 @ https://lore.kernel.org/all/1661496993-11473-1-git-send-email-quic_charante@quicinc.com/ >