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 270ABC43334 for ; Mon, 27 Jun 2022 12:43:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99B4E8E0001; Mon, 27 Jun 2022 08:43:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94BD76B0072; Mon, 27 Jun 2022 08:43:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81D7D8E0001; Mon, 27 Jun 2022 08:43:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 725D26B0071 for ; Mon, 27 Jun 2022 08:43:20 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 38B6134F66 for ; Mon, 27 Jun 2022 12:43:20 +0000 (UTC) X-FDA: 79623981360.26.AC5795F Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by imf07.hostedemail.com (Postfix) with ESMTP id 9E9234009C for ; Mon, 27 Jun 2022 12:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656333799; x=1687869799; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Vwz7bmQD4OdB7Emg/R0Jhl8SPIRZVhFwD9Lti6y7hs4=; b=GIzqKZ9bBk8Iu2IH7Nu3Nco/K4hbdD60EP7Byn4wPDsX8kWXwO6tOvvk wrETvqvxcNYUNikryOsnXJeCpg+8LzPyVhL6Tq+zYZH1uyF1dbJLn51WV 4iIcgEMIdOli4qjUqbPVvZLPf6uaoLQg/0/zxgTiOiATts5RkxONMr+g+ 4=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 27 Jun 2022 05:43:18 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 05:43:18 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 27 Jun 2022 05:43:17 -0700 Received: from qian (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.22; Mon, 27 Jun 2022 05:43:16 -0700 Date: Mon, 27 Jun 2022 08:43:14 -0400 From: Qian Cai To: Miaohe Lin CC: , , , , , Subject: Re: [PATCH v3 1/2] mm/swapfile: fix possible data races of inuse_pages Message-ID: References: <20220625093346.48894-1-linmiaohe@huawei.com> <20220625093346.48894-2-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220625093346.48894-2-linmiaohe@huawei.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=GIzqKZ9b; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf07.hostedemail.com: domain of quic_qiancai@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_qiancai@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656333800; a=rsa-sha256; cv=none; b=sBK9HyxXnvrVCl8DJJs3J08zntQV1X67AqJh/7juGmxCtQFR1Hy1rcO2Ddlpv9Zzb++ZES rdUa00msBQdSuepzmoeGdpM0PQb6ytysNxGSlnA1WYiVKXFwOHtYJ8nrgYj8WbvaWVIC5n mH02BxnpcsqtMtSL3w2WDY1X5sY3Myg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656333800; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Vwz7bmQD4OdB7Emg/R0Jhl8SPIRZVhFwD9Lti6y7hs4=; b=6CfCa3ZkpUFbIZ9Po3uvB5CeIfGGsCA+UpmYrXMXn1NP5i/7AMv2nMmG6AtdX50tgtTPnB dC73xBj1BPwGyR7JUfFAQlfKU2JCDrP7U7jg4BNWcTcdOKJx5E1iMrBhctf9Om/GG6l5Dt mMCOwiucag1wGDg/v8APLwYP2AWdLTY= X-Stat-Signature: kumsw55jazncr5qkyg5ebdq5stoy45nf X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 9E9234009C Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=GIzqKZ9b; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf07.hostedemail.com: domain of quic_qiancai@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_qiancai@quicinc.com X-HE-Tag: 1656333799-777987 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: On Sat, Jun 25, 2022 at 05:33:45PM +0800, Miaohe Lin wrote: > si->inuse_pages could still be accessed concurrently now. The plain reads > outside si->lock critical section, i.e. swap_show and si_swapinfo, which > results in data races. READ_ONCE and WRITE_ONCE is used to fix such data > races. Note these data races should be ok because they're just used for > showing swap info. Was this found by kcsan? If so, it would be useful to record the exact kscan report in the commit message.