Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2372628pxy; Tue, 3 Aug 2021 05:03:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0+b+6EnOt0DFHC2GBjiarEFKv926YYtAALaz9p5PDdgmFnhgw4HMW7fwBkOvUx0XO1hP4 X-Received: by 2002:a02:2307:: with SMTP id u7mr15130852jau.28.1627992208930; Tue, 03 Aug 2021 05:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627992208; cv=none; d=google.com; s=arc-20160816; b=RYLAJScE68B4gZp9zqyaYnNYHJnF2R5GobVNx1EoHMi52Jd4IO7o6J1BY7zatPbQoR 3YgeGzHvgycSV155cxgBDeWEO3aAU/1SIB9oHxaMfTMGPx8Ly7hEv/KlRlK5A9lUX/Qi hwYG3t5YM4E6rWBlcsNh4aVNHMvETeUkEpkRpAD1RUMkHL7dfDmuNziF91BqTZcGKzqB ARiQ+PjB5X1S8fNODT3QwEnwM0EwImNCpOXIHbq//IjlspQbiC59b+4AQLLJLUwszDz8 VVBjFyI0fUkfrtETSElteY9oITT930YCv+HimetGIAAmYxdXaRUUtJYRAeVVeIeTxrgd Xj4w== 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=fqSHKnZTWGmS5kpvDXOu7rtMWWiRcadlbYWKyvYr8uE=; b=sEJTIrsPHhHTD2a76wvMFjOCqETCz60duPMW7EVtlXkWo80AcanCklVpuWUfzaKX5+ RN6zwMs/dFHSPVUaak9FqmP3xbiFLOlFLjrcumN5ROvoLpp6QNCi7mtd+Tk41DvlnH7s pMqJ88qE6PUgKxy54SyJKWgDr7cvqc8wanxwXExBl2KvoNFt1DwKb/0ewxDhOJlcU9bz K0yFWyTEWSToHBf0iVkN5PP1eagb69FZVi33YfkZgkWeJWNmEZo6jfRiAp+EBpg/2hcT JFxpF2LBdxuN3hNDyAy6DULPclrI8J9tkDG46ZSb3FL0UiXTudtNu6JQoGcO8u43EOb0 RqVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AByIIbSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si15680872ils.86.2021.08.03.05.03.15; Tue, 03 Aug 2021 05:03:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AByIIbSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235655AbhHCMCf (ORCPT + 99 others); Tue, 3 Aug 2021 08:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235533AbhHCMCe (ORCPT ); Tue, 3 Aug 2021 08:02:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FACC061757 for ; Tue, 3 Aug 2021 05:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fqSHKnZTWGmS5kpvDXOu7rtMWWiRcadlbYWKyvYr8uE=; b=AByIIbSWvwGMZvxM4zF6gD7Inx jFfSI9m+8WJwHEiJftOedg2iujxIBsRKVVoGpDcsrr0NOGYSrbhkvXBNfCinaPC6vpHr6WKCHdLwe 5ewP37RIvvFlFjWRIVxUD1/2o8ZjKGGiHzasgOe/UUxuoasZAg2QNj+QwOd3OZZX3lnAYXHIwWfyI 57l/JRA/gHSRLcY0AMWI/Pr43vtimbuy1GQ7WcZ4EHs337Oe2RlvWXlPOTRXdinSvudvbgLwVFgBO pqIOlsdSwyIXo2NNYvrtSXkKz1Lkhz4S+c77e5BtgTq6Jh9QRslIHH71Qv6Dv3P+FvukFeoyqWqiN 8Y7k0f6Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAt6b-004c1q-UL; Tue, 03 Aug 2021 12:01:20 +0000 Date: Tue, 3 Aug 2021 13:01:09 +0100 From: Matthew Wilcox To: "Huang, Ying" 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() Message-ID: References: <20210723080000.93953-1-ying.huang@intel.com> <24187e5e-069-9f3f-cefe-39ac70783753@google.com> <8735rr54i9.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8735rr54i9.fsf@yhuang6-desk2.ccr.corp.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?