From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out Date: Mon, 1 May 2017 12:44:30 +0200 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 Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+Egf5RZfiX9Mrx9qmRiyEHW7X9sw9DV6IVHbx+6GND0=; b=msEJwgJXfKS+q9vYgwfrEn5+fp h9X4chkdMDBqg0EMs8r8no3Ym35hyFC2sBNDKn/gqUfq/azr14mI8J1asqb+EBmX63yudPCSpgBy3 XKFIeikUAcCtkOwoIiEkuqWD5XPdq6dDehaICD3bafr3a4A+/lkw15NlZesJtNmWMDbA=; Content-Disposition: inline In-Reply-To: <20170428084044.GB19510@bbox> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Minchan Kim Cc: "Huang, Ying" , Andrew Morton , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrea Arcangeli , Ebru Akagunduz , Michal Hocko , Tejun Heo , Hugh Dickins , Shaohua Li , Rik van Riel , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id 85F4E6B0038 for ; Mon, 1 May 2017 06:44:51 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id n104so11050068wrb.20 for ; Mon, 01 May 2017 03:44:51 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id 36si13369518edo.263.2017.05.01.03.44.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 03:44:50 -0700 (PDT) Date: Mon, 1 May 2017 12:44:30 +0200 From: Johannes Weiner 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> Sender: owner-linux-mm@kvack.org List-ID: 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 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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org 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.