Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp67486imu; Wed, 2 Jan 2019 14:15:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN4MYb0+oNi1UG9wvsMAuppQ5uo2QM0xb7itefSmJilXJ+HRPDHzY3DWymxHW18CbfTnDcNY X-Received: by 2002:a17:902:1126:: with SMTP id d35mr42252148pla.1.1546467342825; Wed, 02 Jan 2019 14:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546467342; cv=none; d=google.com; s=arc-20160816; b=XORX72avj0BvE0FAXs62dAlRmlRJREJN7hr5Y6R8qjnRgzG/NEgoM7wfv7g6wIyKlL sSxdmx5J8iqpdOu3CCkVJe9/g8cZs/q2yOSvr108cluhO4xyZXG3b5Ez9jlghDUlLWHG PcGJniQkDGYNuIhyiX/X3wsyDQSDG+77xunmMZlkgQOpS/Cs2YbNQwckhuqWaVTxG0gS NV5edVBO90emO31Hq17OzZS8XZTnOw2nfgL386fCkT/cic24olx1pvPDsLEpPmn0weqs NQQ2yUMRwzed/TnUjLwKdL/OP9I4fHnSAxTBnLLLyJI5N5u57xF7I0HwFmfnLPp4WfQv GQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jwNzLMTXb+K6/MpjHKyHQEI4PyVQzu80D6rs7MUtTdg=; b=vcyio0hvfchZyE8pWIuDW4leA3K5x/OKWIf3meuxJ6c89jCvQb6IasHDuyjhYIYC21 AWvrG6PjbgcbagqAEOIznUKD5icd5E/i7S5+wjQDbpw8hmUq5otbLtALrwGtcaF3H9ak j7NjPckbOCoZuJ+4Qam7gHDB8Zoosdp25Ll0uGRS67ZVsDYqwE/XTleWVsxjVyGi7Ci1 WXrrDwU4f9HSAQpBM1IZlW8FVj2t04isiZciApI83R4RjWj9sr0SmkJtpKjmSp5W0VX8 +ymmBUnJBuhrY7vltJ3hX+zwyYye906sesBCdSTrdCPjqHROxZx+FBR2Ita5jVr38aGX dpTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=FVUoshR6; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si53222911pfe.243.2019.01.02.14.15.27; Wed, 02 Jan 2019 14:15:42 -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=@digitalocean.com header.s=google header.b=FVUoshR6; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbfABUFg (ORCPT + 99 others); Wed, 2 Jan 2019 15:05:36 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:45336 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbfABUFf (ORCPT ); Wed, 2 Jan 2019 15:05:35 -0500 Received: by mail-oi1-f196.google.com with SMTP id y1so26016815oie.12 for ; Wed, 02 Jan 2019 12:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jwNzLMTXb+K6/MpjHKyHQEI4PyVQzu80D6rs7MUtTdg=; b=FVUoshR6kTZsAcEIlAy811Gn+sD88fDMXWF8uWPdUFp89IZpOvZpAARU1UwUPf4knd IYVH3843fsz4ValbAcrlfx7/Fi8mF5KXcxbrukGYj3xWVRUz+Gk50iCfpPWRzF+DvTbR LRmlxBeFdq0VoTBqVljyhFq6paxGdiziW7vhU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jwNzLMTXb+K6/MpjHKyHQEI4PyVQzu80D6rs7MUtTdg=; b=DwezmX7x7++9dqMNiqpu3IRStt5IovITLjWTz5XVeXF+XClNvJdxGaqDEJgjYiwkHe 3FfTlh8TtArnXgaBpUbwcG9KYBZptEz/22L+PFdFUUSqjjwAsVQel39kU4JOgD0plduc xk0jJafzBZEWgfa+PzZtSn8fnpZEu++eR6gpTgO2jjf9/rvbPFESddeJh5a6IRq3sSkO Lj9XbnPhLtW6SSmwSqE9g13xPI1ig2dhYkUADjMTyWSrMR4aF6pLlfhjVKJHllxoL9vN 5Xo/gDaQqlfVGJUgIenxWfkWtnYQGmWkt6ls7sylzGGuxBx0Je1qXriwLSrp65LhYd72 WhTg== X-Gm-Message-State: AA+aEWZB6VzfP/EuS6VyMk51A7VovUjQMbbLQLjJKM+HmqHKNaG8iRPP m8SrOsIPUDoEW106HSIJP+/TWASsr0vrrQ63KhPGKw== X-Received: by 2002:aca:4506:: with SMTP id s6mr28611606oia.115.1546459534608; Wed, 02 Jan 2019 12:05:34 -0800 (PST) MIME-Version: 1.0 References: <20181203170934.16512-1-vpillai@digitalocean.com> <20181203170934.16512-2-vpillai@digitalocean.com> In-Reply-To: From: Vineeth Pillai Date: Wed, 2 Jan 2019 15:05:25 -0500 Message-ID: Subject: Re: [PATCH v3 2/2] mm: rid swapoff of quadratic complexity To: Hugh Dickins Cc: Matthew Wilcox , Andrew Morton , Huang Ying , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kelley Nielsen , Rik van Riel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 2, 2019 at 2:43 PM Hugh Dickins wrote: > > Wrong. Without heavier locking that would add unwelcome overhead to > common paths, we shall "always" need the retry logic. It does not > come into play very often, but here are two examples of why it's > needed (if I thought longer, I might find more). And in practice, > yes, I sometimes saw 1 retry needed. > Understood. Sorry, I missed these corner cases. > I don't use frontswap myself, and haven't paid any attention to the > frontswap partial swapoff case (though notice now that shmem_unuse() > lacks the plumbing needed for it - that needs fixing); but doubt it > would be a good idea to refactor it out as a separate case. > I shall rework the shmem side to take care of the frontswap and retain the retry logic in a simplified manner. Thanks again for all the comments and insights.. ~Vineeth