Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3649593imj; Tue, 12 Feb 2019 02:18:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IYlxniJzHQXy4dVTuh22rOXFzTzyhAZ0qkKUJ4F59D23XOTVHkLodnJJ1Hne6VPGyWsq9+x X-Received: by 2002:aa7:8497:: with SMTP id u23mr3229006pfn.253.1549966689375; Tue, 12 Feb 2019 02:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549966689; cv=none; d=google.com; s=arc-20160816; b=Yqj6xl30x5f0/s1Xo2jPNlu1s4W1OkgjtGJRVgylR/PSq0pgtk0C9DaFe24PFZ9CQw ub7+A0WEsmNpMmZwHKXcwbxww+ZRASPZjN1ekflVTEVR6DugMzYxdrTqqNoXtIZoThGK yK/G141ASj9/gkXE+eDf00aOKRJwDz7Sa9Zg9HzttM7LfzZHuAVWJJTRrKqbQ40MJ51X FLAvTno+mulEeHPUqxSZC24EqA030uO7Fl5NEzqXqpa3CIiK8t/cxjKV0W2HVv3yOVFn dXE4ugFvClclElc706dgMXgXMjEh1k+sWjFAO7mAHDyQ0IC1yziQ2A1q0sy6EGwjuVu+ yt3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=g0JsiH41KjwvocfsMp0bTb3XeLXE9iKeGB1xz8dT32A=; b=GLhm8MscxqygeJoVCiDDNU+h+GKTpgj9rolmB5pmSppCpM4rqRf6RhOPq09bYcVCQj /YGuULMTQlshLai7yOO3RkPKEPTb3yRpAJI2JGt9cMcC/Nqc1I9SAXHXb37nWMHeV8wn HxvDsMzD2ULi4eD/F5QtlhPhazY4bpWTuu/korzpYMDxlCLH+P4mxWxBppyX0HmnpnYG P/e5HnQWz6nsuc/Er8agp/YhjdN7jQRxGG7B48ja45Ux8aAuyrstxbeFzHsyhpteRnCf aL5SahsREA9T9zDfUKXMhBCnkzRtvieUKeOoD0GtZwctOpjkApXUVnerKfZ9dX/vIWpO Vqlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DWfwx5tb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si2830781pgv.168.2019.02.12.02.17.52; Tue, 12 Feb 2019 02:18:09 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DWfwx5tb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728216AbfBLKN2 (ORCPT + 99 others); Tue, 12 Feb 2019 05:13:28 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:36133 "EHLO mail-wr1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726216AbfBLKN2 (ORCPT ); Tue, 12 Feb 2019 05:13:28 -0500 Received: by mail-wr1-f54.google.com with SMTP id o17so2018700wrw.3 for ; Tue, 12 Feb 2019 02:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=g0JsiH41KjwvocfsMp0bTb3XeLXE9iKeGB1xz8dT32A=; b=DWfwx5tbB6IVo4HIIiFhkNsfJ4SZ6/zDimJNgTlVGK+CvuSgxyZcPuDigAGLkxqqHn aFEj3qBL+1KRbmVapS9XSNRwti4AEpOCmAiow73iKHa6A1utJW1qabjNj/+e7aCRWGFa mf406VjNtP0kT3H6Yf5OlhFAOfQwD6DmX8RII= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=g0JsiH41KjwvocfsMp0bTb3XeLXE9iKeGB1xz8dT32A=; b=FqKyAJtITlvhWmvTmEwl2Pf5WalXw/+6Saz9Q/1qDCrtNRfOGywmulWJaAgRnEhQqt syta9i7vsIEc6XUQHxc1ClMyrZWCAo2X10H56dkc0d6nQgcgw/KKvfW0HNcYVFSJSVr3 +XZM+LvB5bV+fPPns0Z0n9HxlDqEn6emmOP2FR2ILAURGCTO7vkwU5Ppx16CtcO2MOYB efR+scfq+Sj2RiIE30Cre415xDdi5QxaW7CpfD+uu2AsZ6I2J7ONxoAYDReXPDt+8UNd WsL+lD0r+DW0kXROXM9Stb5wrxp7noPeBqdExMY/myKfW+krnqNPcUQ5tekCzeUoSkWs vimQ== X-Gm-Message-State: AHQUAuYB8OEHk5Tts8NuEVxySjSzqDyvAJ8391qZqA78RFgbnz0V90qv yca53slrpV6oT1XWunRAx//vRw== X-Received: by 2002:adf:9dc4:: with SMTP id q4mr2340947wre.330.1549966406403; Tue, 12 Feb 2019 02:13:26 -0800 (PST) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id o9sm1809180wmh.3.2019.02.12.02.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 02:13:25 -0800 (PST) Date: Tue, 12 Feb 2019 11:13:16 +0100 From: Andrea Parri To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , "Paul E . McKenney" , Minchan Kim , Johannes Weiner , Tim Chen , Mel Gorman , =?iso-8859-1?B?Suly9G1l?= Glisse , Michal Hocko , Andrea Arcangeli , David Rientjes , Rik van Riel , Jan Kara , Dave Jiang , Daniel Jordan Subject: Re: [PATCH -mm -V7] mm, swap: fix race between swapoff and some swap operations Message-ID: <20190212101316.GA6905@andrea> References: <20190211083846.18888-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211083846.18888-1-ying.huang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Alternative implementation could be replacing disable preemption with > rcu_read_lock_sched and stop_machine() with synchronize_sched(). JFYI, starting with v4.20-rc1, synchronize_rcu{,expedited}() also wait for preempt-disable sections (the intent seems to retire the RCU-sched update-side API), so that here you could instead use preempt-disable + synchronize_rcu{,expedited}(). This LWN article gives an overview of the latest RCU API/semantics changes: https://lwn.net/Articles/777036/. Andrea