Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2929674iog; Mon, 27 Jun 2022 06:00:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1us2j+55wvAhJAhmrWyoytIWex1FP/TLPDbdyr6CevqaPAxmLtfJjUk+VW4QJnhBnyqatzJ X-Received: by 2002:a05:6a00:2395:b0:525:8980:5dc7 with SMTP id f21-20020a056a00239500b0052589805dc7mr13435498pfc.8.1656334835373; Mon, 27 Jun 2022 06:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656334835; cv=none; d=google.com; s=arc-20160816; b=jUgF1kBAEy3PSmWFhtOWjkoRmaxsYt+5Ide4dcx9SRJ4pNcDRHkDiSExRvoatpoGUb dD9ChmGQca97raRg5NvtvCDzjxM3xE5EtEAp4NvgW7wueTrgM06tHdE1MK8uie9nAmYX TtL5LNBCeA/d60KPeZWy/rB7FnMz/nf8UxGrR5sFwFJT1YxKv6jcQMGCRwW7WzJdj8wL aYDFEZkpx7cKq63ukpB6A+lEx7WiSOoJ0fPiej7NRqCDdeKex9YjPpBDofBHbr5hr0Hk WSEQ3Bl+vqv2TW6DOU2XuzNkII9hlsAsqUafCJfcQH+dYaTC4VZyYO66Z7pHiCbtJfCx Uekg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vwz7bmQD4OdB7Emg/R0Jhl8SPIRZVhFwD9Lti6y7hs4=; b=BDOg/xodD/YzVvAW4gmbHDynmUnYBpGXiKTtph924HaSIKdrJstk/XjrTQckqCvRZP P/sPWYp4F3NcZLpOZtxji5hi4S3JQVt5blk/VA1zEqxs7smlyME0plmCxOyA+07OzQvc mNc5c7UpOHa1yp715YEFSfqFXeg3pCCyzePKq+OVDWFkn+eDl8cFdvY9zaiCm93YA/Y9 4jGX+yzzJRbCsr/oGm7YDrbTgoAx6atqG6DcDQpFTG8piOX9miUuJYVHaAtml2PYLM9b u05bpJcR4mr+vxqhaaVNfv69RxuQ4CeRl1VfAl0pcnLVixDaEcyMTxvKmzr99ZI8egGl z/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=IiAT+HIW; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020aa78f05000000b0051c31974ad5si7500207pfr.65.2022.06.27.06.00.22; Mon, 27 Jun 2022 06:00:35 -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=@quicinc.com header.s=qcdkim header.b=IiAT+HIW; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235053AbiF0MnU (ORCPT + 99 others); Mon, 27 Jun 2022 08:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235033AbiF0MnT (ORCPT ); Mon, 27 Jun 2022 08:43:19 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924519594 for ; Mon, 27 Jun 2022 05:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656333798; x=1687869798; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Vwz7bmQD4OdB7Emg/R0Jhl8SPIRZVhFwD9Lti6y7hs4=; b=IiAT+HIW2Kx31Ic6qOkw6OrVL0nSxWdVMjLYkNs6iy13SRuz+abFTwy2 xl8Wt8QSgoA1x3pxOu/5TMZbOTrzw0EajD6+O4JddT9DrSolt1epQolOo ZXLvBZZp8CS8cQ8kirH6RprJc911A0HPYezTocBXB8rhV/PD/ZRuM8WIS c=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.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) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 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.