Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1234374img; Tue, 26 Feb 2019 17:14:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IYmEKxAKILGgs8teIpHVm4nSMPz/obp5BvuG1u6yKMWkSdGQpdP2CgNo4Maa/ltwCalSxPc X-Received: by 2002:a63:2882:: with SMTP id o124mr353895pgo.446.1551230060594; Tue, 26 Feb 2019 17:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551230060; cv=none; d=google.com; s=arc-20160816; b=k1tNmv6wiRP3PqoufcrKogjaO8XpG1tc2VyaIrNuc77QgeWHvQYP5c6URdgOnMLaLX SwEz9spOQ5uqricjhnCkGdzTFRjd2ZexpfAJcL9v/rTpl36NxxA7uTblPT5TxKmJxglp bBDOuMEe6V31srFr6sCiTPVHOUCcwgQIZeMLNxfvnU+yV49mNNFLv8Iab/6iczWNzGNf WvNS00+gGDZT0I5TOT9sXyEIxo9g8hcq75eDNqyUWO0PGNVDL3Oda2EZ/dHLdZVPekwC +GLE7KssN/HXVwASdrIGpzsWdin/cY4Fz7HaNh0N6rDcQkM029Svs3ZV/zjyPXqsEis/ npeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=lAfcMC57fT06SDDCZL0qyTjcBZoOPGg8cyHaZt44poc=; b=Rv2tGKaY6QwdSWUhQAHywf6RQkAGTLBpOe37MHUCM8O7jdndhLctqjcT/V7XajnaPR LK6/IvMlgecne8I9nYKnOftuRNUOYDgO8dm9PbP9e6cnItH1NTYWeg7nSrJlMxBS28lG nWbsCJKdTvuu6OPbGlYYqsHn1F++/euE8VoS0J0xZCGU3uHmq02SBhusjEh+cXVPjOgT usrIr2cC6oU34Jh3aB+mDCCsAcwnsU1K3Itj77FsufXLa++uCEA6Srwl7RXYbFU9ido1 g+LUksCwB1aDfFi9beAiNPWle/bJgnW3NlGlCFwqc3rlPwyW8kf6Bn6liXLRq0VZJv31 HaRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o25si4697677pfa.259.2019.02.26.17.14.05; Tue, 26 Feb 2019 17:14:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbfB0BNT (ORCPT + 99 others); Tue, 26 Feb 2019 20:13:19 -0500 Received: from mga14.intel.com ([192.55.52.115]:43123 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728766AbfB0BNS (ORCPT ); Tue, 26 Feb 2019 20:13:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2019 17:13:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,417,1544515200"; d="scan'208";a="129624334" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.151]) by orsmga003.jf.intel.com with ESMTP; 26 Feb 2019 17:13:14 -0800 From: "Huang\, Ying" To: Daniel Jordan Cc: Andrea Arcangeli , Andrew Morton , , , Hugh Dickins , "Paul E . McKenney" , Minchan Kim , Johannes Weiner , "Tim Chen" , Mel Gorman , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Michal Hocko , David Rientjes , Rik van Riel , Jan Kara , Dave Jiang , Aaron Lu , Andrea Parri Subject: Re: [PATCH -mm -V8] mm, swap: fix race between swapoff and some swap operations References: <20190218070142.5105-1-ying.huang@intel.com> <87mumjt57i.fsf@yhuang-dev.intel.com> <20190226230729.bz2ukzlub3rbdoqp@ca-dmjordan1.us.oracle.com> Date: Wed, 27 Feb 2019 09:13:14 +0800 In-Reply-To: <20190226230729.bz2ukzlub3rbdoqp@ca-dmjordan1.us.oracle.com> (Daniel Jordan's message of "Tue, 26 Feb 2019 18:07:29 -0500") Message-ID: <87imx6rq39.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Daniel Jordan writes: > On Tue, Feb 26, 2019 at 02:49:05PM +0800, Huang, Ying wrote: >> Do you have time to take a look at this patch? > > Hi Ying, is this handling all places where swapoff might cause a task to read > invalid data? For example, why don't other reads of swap_map (for example > swp_swapcount, page_swapcount, swap_entry_free) need to be synchronized like > this? I have checked these places. They are safe because there are some locks (like page lock, page table lock, etc.) held to prevent swapoff. I found another place in the kernel that is unsafe: the mincore. I have a patch for that and will post it (in fact again) after this one is merged. Best Regards, Huang, Ying