Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3000185iog; Mon, 27 Jun 2022 07:14:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t0y1sNvt3F2jO56XXMNaC/+Evvol8aIeKWPikdTE5j+a53LCDdlG31IOWCpJl/r8YLT1IH X-Received: by 2002:a05:6402:3329:b0:435:8136:cb70 with SMTP id e41-20020a056402332900b004358136cb70mr16930768eda.106.1656339270092; Mon, 27 Jun 2022 07:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656339270; cv=none; d=google.com; s=arc-20160816; b=qrus4EsP8fg/YuqlV1OSxpX9TKyhmAbPCt38FLuGqY94saT6I5V5P/8UMPRZNiuTgI vnWW690W3OmKR/s9Z3tRpeRboYwBcHutYk3AF91CGkcdDBCG4FQCtlgK8Sdy8KqAibtf 4Mr8eRDXYnPVfFXoB75JGDnJkD5HEe/rJq8UOMwRzCRqEsl0WOqo+eF1ljGqtuL4vidy jdAR7A/UKpZCzY1ErzwCdbhu1uGtIq0vWdSrqjW3mhlh6LHv/cG4n3KEfy2/i+IH4aQt 5txoyeb7HvhlJ7EVvnA9a7P9BjSXfdUmUwSQQvQwiBZJs3thaC3/LxlfCDPhYGx2tmk7 ilgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=SFsCUBqglVX954xCdyjsII5kgX2TueUjf3h+nZLAmmU=; b=RX78gHDgBttXfwHSxu5knbqXFc2Y7xkL3u0gGz3onuPhKm6dhEBpSfTpkZmQujwyUb HQ2401RlBcoqlcsebnpQX7QFmQUl3G5SoxhT6i/y61XSnC9ZRDDgkAaBvxMQNv5MMnzc sd/rJRjbsQhaUut3PNXfZz6kVWSpN6FPYh5iQEn7BiIJJih6in+860xPXKow0B3hXX3T CFJMm7SHDYsb8XaU0+Pi/VP6Dao0uG+YCfP78n/8W3Pm249z4B9brU1EAQsaLOvGSDgD JbAFFd4neCAMi7CpddxN1akpEByPk3OKX6sRKEVq8ujYzK2DboCiI/FUBhJzt2X2kKKH 2LBw== 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 gu4-20020a170906f28400b007262c7d558fsi11194313ejb.292.2022.06.27.07.14.05; Mon, 27 Jun 2022 07:14:30 -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 S235785AbiF0N1u (ORCPT + 99 others); Mon, 27 Jun 2022 09:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235683AbiF0N1s (ORCPT ); Mon, 27 Jun 2022 09:27:48 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8597641B for ; Mon, 27 Jun 2022 06:27:47 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LWpRZ0xQFz9spN; Mon, 27 Jun 2022 21:27:06 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 27 Jun 2022 21:27:44 +0800 Subject: Re: [PATCH v3 1/2] mm/swapfile: fix possible data races of inuse_pages To: Qian Cai CC: , , , , , References: <20220625093346.48894-1-linmiaohe@huawei.com> <20220625093346.48894-2-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: Date: Mon, 27 Jun 2022 21:27:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 2022/6/27 20:43, Qian Cai wrote: > 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. Sorry, it's found via code inspection. Thanks. > . >