Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp838983img; Fri, 22 Mar 2019 09:36:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCIp4AKiPNTavVPKOj8sSE3r3s3Cez0Hlu5UWyfEYk66thT7RFpLZK6TC64TCU0UmtWEAa X-Received: by 2002:a63:5460:: with SMTP id e32mr9870694pgm.401.1553272589571; Fri, 22 Mar 2019 09:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553272589; cv=none; d=google.com; s=arc-20160816; b=LJqwe8ZtDXZfoA0qgE/yV2xBQwFlkCP/arxLn0Tx6kJ0ATItvuuBMTOFl8XXghl8lG pSuZfgHIzgBpgYn4SjzFHCPV3JPTCL1NRNVGSlOtH9uuG7F+h6fu9+NP2RndAd+gvBEc TCL4hXENnssliJZqF0exq6ZQiPGrTDHS1YCX/lvqRFcYnBeh1wS9kysEoQHChjuubBm3 mDAbEEq/tlVscIDn9eZUU51I74wnB8FcmqJvbqBVLpTg8tFN2dhPnaSKaJZIPCDswfRg 726WSxd2QJRprPfXiV6Dv8N6Jl2Fhp/xkrgIXGWtKpqDmSRdt7TWwgLeoyMPquA+ZsKg r+SA== 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; bh=y1kranFGlBl8Y4Icc+/VnJOTsxFjXo9NxNnnER27N4o=; b=LROVCBv2SaE5mn/OZywZnvnhSu0uPxHZF7sdxhmJ6Lpr/+gCQ5qPtcSvbp4w4wp/56 HGHaZf4WWqKJkLtjwgUqGTmPC5PfGpafbQ8Trt0hdj5VEH1NLy510qXLDrEVoPB8DuGH MjCuZ7PM3n3R8KjnM7IZP63/FYv02DYrKFmlMmBboI4acd47C7wWvExTPfW5ZTU0z79K UmkRf7neqbVKYmNw4AAi2ch0nZZNVQSe+V3ndU9/47pDiyhlc4Ptjzi/R1cNv6A3ENN7 TrtMrUJRzattyhH8z4n/HydJS9EXzGwrVblPOM6jgj1fV4jRKmthqMuS0RmZl+VKcAv+ x3BQ== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si6905980pfa.215.2019.03.22.09.36.10; Fri, 22 Mar 2019 09:36:29 -0700 (PDT) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbfCVQdk (ORCPT + 99 others); Fri, 22 Mar 2019 12:33:40 -0400 Received: from mga04.intel.com ([192.55.52.120]:16971 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfCVQdk (ORCPT ); Fri, 22 Mar 2019 12:33:40 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2019 09:33:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="142975999" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2019 09:33:39 -0700 Date: Fri, 22 Mar 2019 10:34:41 -0600 From: Keith Busch To: Yang Shi Cc: Keith Busch , Linux Kernel Mailing List , Linux MM , linux-nvdimm@lists.01.org, Dave Hansen , Dan Williams Subject: Re: [PATCH 3/5] mm: Attempt to migrate page in lieu of discard Message-ID: <20190322163440.GB31194@localhost.localdomain> References: <20190321200157.29678-1-keith.busch@intel.com> <20190321200157.29678-4-keith.busch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 21, 2019 at 04:58:16PM -0700, Yang Shi wrote: > On Thu, Mar 21, 2019 at 1:03 PM Keith Busch wrote: > > + if (!PageCompound(page)) { > > + if (migrate_demote_mapping(page)) { > > + unlock_page(page); > > + if (likely(put_page_testzero(page))) > > + goto free_it; > > + > > + /* > > + * Speculative reference will free this page, > > + * so leave it off the LRU. > > + */ > > + nr_reclaimed++; > > + continue; > > + } > > + } > > It looks the reclaim path would fall through if the migration is > failed. But, it looks, with patch #4, you may end up trying reclaim an > anon page on swapless system if migration is failed? Right, and add_to_swap() will fail and the page jumps to activate_locked label, placing it back where it was before. > And, actually I have the same question with Yan Zi. Why not just put > the demote candidate into a separate list, then migrate all the > candidates in bulk with migrate_pages()? The page is already locked at the point we know we want to migrate it.