From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S378795AbdEAKo7 (ORCPT ); Mon, 1 May 2017 06:44:59 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:48022 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033190AbdEAKow (ORCPT ); Mon, 1 May 2017 06:44:52 -0400 Date: Mon, 1 May 2017 12:44:30 +0200 From: Johannes Weiner To: Minchan Kim Cc: "Huang, Ying" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Arcangeli , Ebru Akagunduz , Michal Hocko , Tejun Heo , Hugh Dickins , Shaohua Li , Rik van Riel , cgroups@vger.kernel.org Subject: Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out Message-ID: <20170501104430.GA16306@cmpxchg.org> References: <20170425125658.28684-1-ying.huang@intel.com> <20170425125658.28684-2-ying.huang@intel.com> <20170427053141.GA1925@bbox> <87mvb21fz1.fsf@yhuang-dev.intel.com> <20170428084044.GB19510@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170428084044.GB19510@bbox> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 28, 2017 at 05:40:44PM +0900, Minchan Kim wrote: > However, get_swap_page is ugly now. The caller should take care of > failure and should retry after split. I hope get_swap_page includes > split and retry logic in itself without reling on the caller. I think this makes the interface terrible. It's an allocation function to which you pass a reference object for size - and if the allocation doesn't succeed it'll split your reference object to make it fit? That's a nasty side effect for this function to have.