Received: by 10.223.176.5 with SMTP id f5csp1727001wra; Thu, 8 Feb 2018 02:26:31 -0800 (PST) X-Google-Smtp-Source: AH8x224BzPjEKINGAe9Rq8mPmcdMF8vYDiXSm6hCB4omXTT548OwVP175n96g7B43fM+KSnB7pQQ X-Received: by 10.99.114.6 with SMTP id n6mr164946pgc.6.1518085590889; Thu, 08 Feb 2018 02:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518085590; cv=none; d=google.com; s=arc-20160816; b=CaB0uS4PFuzbFBDiLHiX9yrFUqNe1b1fJt720QN4/vdSp137aXAkuZkDovNKaTetgR jwuc9AJo8L9B0agmbFj82ftqDvdoTRg6HHARaPI5Lz7S53om3v1xXDKUoPKDzoq7yhAW moHaglADWSx5KdVGEwIfggPThavYXoNTKXpBYk1fjFcqpQT9zqMG72Q9AY+im1LUv/UP DPax5E69I0ndxyhVhNVEjHC+efJ19o5wQksrLrQvrwMBk6AslHv7scKRSkVuKQo+eMCn VYer97SU9Ge4kAmu6+jetA1txgqSSL1qn/MJrC/f7w+3bMJkVnvgVNISDwA7Pq0V6Lk6 TAeg== 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:arc-authentication-results; bh=3znYVh0HbInxX2st/2aT7LDUnHAkA5mImraH4dZEA3Y=; b=ajwZOs/IdDKNluNkpB0gSgN6ZYtXhBm9/ORT78EEqAeMF8QBHJW2BUynAatJu0p6rx 4+qXyXbge9yv5xwF7Gzb/fCzb20Fd7FSblZ/vwjh3d/dCCzg6eCMcqTwSWsmbPf+w4PI cbGiyoxMzR+CpJS6D9qawFA7wWsHwj/Eyd+lhVA1HoG1oRmwXwool4TG2PP6f0xI5xKm QOc4h+0eewSI1v2sAd4pmAeSrs9ks8a7StMk5vOqGPycy7QMHsCOVs0UJUithR7nPXdA Q2Dt9C3lsN+uys5Vj3lWlgEeqqk9o+bYfbRrC8ebX7R5lRVq26igNs/EcCcmEJ19Qcs3 xUjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AA0EByc7; 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 h13si937615pgn.782.2018.02.08.02.26.16; Thu, 08 Feb 2018 02:26:30 -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=fail header.i=@gmail.com header.s=20161025 header.b=AA0EByc7; 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 S1752059AbeBHKZ3 (ORCPT + 99 others); Thu, 8 Feb 2018 05:25:29 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:35600 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbeBHKZ1 (ORCPT ); Thu, 8 Feb 2018 05:25:27 -0500 Received: by mail-ot0-f193.google.com with SMTP id a2so3849655otf.2; Thu, 08 Feb 2018 02:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3znYVh0HbInxX2st/2aT7LDUnHAkA5mImraH4dZEA3Y=; b=AA0EByc7AhCr7ahgfbYJjBM89GVdMzFY8k3natyJq6Acj73sNvI5pNxLsggN0Jl3rr H4uKZvjAF/ze7INGsG9Vv0kzV43EECvdi0no7xJyks2YMwCqoXzZpELLt4Juijr3SX6U dKXpjr6H7lyEl5mL7TuqYKzfWbyoD32hGh+LY7ge+AIysz00a2a7zcpc8pxMY8yrLJ5p gOv54G5pI3LG9JVc+wJHuC1trXDVV+28Phie25eTwYcK34EGXPYwA1bbFgS/O0guHnb/ TA4XpEZAm+4DmT4l9xqqoESRWoXo5975K8eFE4oPwq7pEg+oJR11KEnZ3kxueojtB6oD IQ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=3znYVh0HbInxX2st/2aT7LDUnHAkA5mImraH4dZEA3Y=; b=A6JLh3fgETEDn/dUTX43Y9vebQ/JtEKQUwDpwJytPGM0g5F71DXLh7WUMhfVkWz2pD rJ7cQIYubWJaN8T9KzzGGqXPD3UM2JRG4Zw8ezDw3+Y8iPP7USK/XSSR7yC4VCDJOJ4x 1sExPnMCrJZPHdYGgeb15TzXt+T/ZT6tBwSXANdZqUgHZ3gdczhKOmqJaz/p70LqtVdV TYs7Ge/9OceGxYnaV4zoz2lo7hK2aBCFnjfR51v5WYa8I7z0rC2AQ0zJJf2mBC0QRRs/ eYQFQBJ0j2VxLHQUyCp9wPzZN2vuMQXZZoX5liURDPevrN7iHIGCIRl9YawFEsGyULgB WWww== X-Gm-Message-State: APf1xPCvM42tMjcuVfVc3HVyZ0SuT7HlBBRODE20CUI68eiuoOHx4JGG cFCgBKnF3p3nWLOO0lacLEc= X-Received: by 10.157.48.60 with SMTP id d57mr149735otc.140.1518085526517; Thu, 08 Feb 2018 02:25:26 -0800 (PST) Received: from eng-minchan1.roam.corp.google.com (70-90-167-36-CA.hfc.comcastbusiness.net. [70.90.167.36]) by smtp.gmail.com with ESMTPSA id g52sm1472499ote.39.2018.02.08.02.25.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 02:25:25 -0800 (PST) Date: Thu, 8 Feb 2018 02:25:21 -0800 From: Minchan Kim To: Sergey Senozhatsky Cc: Andrew Morton , "Huang, Ying" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Konrad Rzeszutek Wilk , Dan Streetman , Seth Jennings , Tetsuo Handa , Shaohua Li , Michal Hocko , Johannes Weiner , Mel Gorman , Shakeel Butt , stable@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled Message-ID: <20180208102521.GB74192@eng-minchan1.roam.corp.google.com> References: <20180207070035.30302-1-ying.huang@intel.com> <20180207130534.259cd71a595c6275b2da38d3@linux-foundation.org> <20180208013635.GA596@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180208013635.GA596@jagdpanzerIV> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 08, 2018 at 10:36:35AM +0900, Sergey Senozhatsky wrote: > On (02/07/18 13:05), Andrew Morton wrote: > [..] > > hm. This is assuming that "cluster==true" means "this is thp swap". > > That's presently true, but is it appropriate that get_swap_pages() is > > peeking at "cluster" to work out why it is being called? > > > > Or would it be cleaner to do this in get_swap_page()? Something like > > > > --- a/mm/swap_slots.c~a > > +++ a/mm/swap_slots.c > > @@ -317,8 +317,11 @@ swp_entry_t get_swap_page(struct page *p > > entry.val = 0; > > > > if (PageTransHuge(page)) { > > - if (IS_ENABLED(CONFIG_THP_SWAP)) > > - get_swap_pages(1, true, &entry); > > + /* Frontswap doesn't support THP */ > > + if (!frontswap_enabled()) { > > + if (IS_ENABLED(CONFIG_THP_SWAP)) > > + get_swap_pages(1, true, &entry); > > + } > > return entry; > > } > > I have proposed exactly the same thing [1], Minchan commented that > it would introduce frontswap dependency to swap_slots.c [2]. Which > is true, but I'd still probably prefer to handle it all in > get_swap_page. Minchan, any objections? I didn't want to spread out frontswap stuff unless it has good value because most of frontswap functions are located in mm/swapfile.c at this moment. It gives me good feeling frontswap's abstraction is wonderful. However, if frontswap matainer has no problem, I am not against, either. Thanks.