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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6282CC432BE for ; Wed, 4 Aug 2021 09:01:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F37FB60EE9 for ; Wed, 4 Aug 2021 09:01:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F37FB60EE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6F8578D004E; Wed, 4 Aug 2021 05:01:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6808B8D002D; Wed, 4 Aug 2021 05:01:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5490F8D004E; Wed, 4 Aug 2021 05:01:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 3705C8D002D for ; Wed, 4 Aug 2021 05:01:46 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E59D2181E4E2C for ; Wed, 4 Aug 2021 09:01:45 +0000 (UTC) X-FDA: 78436805370.15.F68F087 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf23.hostedemail.com (Postfix) with ESMTP id C81F79009785 for ; Wed, 4 Aug 2021 09:01:44 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10065"; a="212019382" X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="212019382" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 02:01:43 -0700 X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="667757443" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.119]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 02:01:40 -0700 From: "Huang, Ying" To: Matthew Wilcox Cc: Hugh Dickins , Andrew Morton , David Hildenbrand , Yang Shi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Miaohe Lin , Johannes Weiner , Michal Hocko , Joonsoo Kim , Minchan Kim Subject: Re: [PATCH] mm,shmem: Fix a typo in shmem_swapin_page() References: <20210723080000.93953-1-ying.huang@intel.com> <24187e5e-069-9f3f-cefe-39ac70783753@google.com> <8735rr54i9.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Wed, 04 Aug 2021 17:01:39 +0800 In-Reply-To: (Matthew Wilcox's message of "Tue, 3 Aug 2021 13:01:09 +0100") Message-ID: <87czqt4m8c.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf23.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=ying.huang@intel.com X-Stat-Signature: rtua1jsggcuzxmszoifkdc1bax6z768u X-Rspamd-Queue-Id: C81F79009785 X-Rspamd-Server: rspam01 X-HE-Tag: 1628067704-537073 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: Matthew Wilcox writes: > On Tue, Aug 03, 2021 at 04:14:38PM +0800, Huang, Ying wrote: >> Matthew Wilcox writes: >> > But I REALLY REALLY REALLY want a reproducer. Right now, I have a hard >> > time believing this, or any of the other races can really happen. >> >> I think the race is only theoretical too. Firstly, swapoff is a rare >> operations in practice; secondly, the race window is really small. > > So do something to provoke it. Widen the window. Put an msleep(1000) > between *pagep = NULL and the call to get_swap_device(). That's assuming > that the swapon/swapoff loop that I proposed doesn't work. Did you > try it? I haven't tried it. Do you agree that the race is possible in theory? But if you still really want it, I can try to do that. Best Regards, Huang, Ying