Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933288AbcDKNtW (ORCPT ); Mon, 11 Apr 2016 09:49:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:39934 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932431AbcDKNss (ORCPT ); Mon, 11 Apr 2016 09:48:48 -0400 Subject: Re: [PATCH 08/11] mm, compaction: Simplify __alloc_pages_direct_compact feedback interface To: Michal Hocko , Andrew Morton References: <1459855533-4600-1-git-send-email-mhocko@kernel.org> <1459855533-4600-9-git-send-email-mhocko@kernel.org> Cc: Linus Torvalds , Johannes Weiner , Mel Gorman , David Rientjes , Tetsuo Handa , Joonsoo Kim , Hillf Danton , linux-mm@kvack.org, LKML , Michal Hocko From: Vlastimil Babka Message-ID: <570BAB3E.1060601@suse.cz> Date: Mon, 11 Apr 2016 15:48:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1459855533-4600-9-git-send-email-mhocko@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1072 Lines: 26 On 04/05/2016 01:25 PM, Michal Hocko wrote: > From: Michal Hocko > > __alloc_pages_direct_compact communicates potential back off by two > variables: > - deferred_compaction tells that the compaction returned > COMPACT_DEFERRED > - contended_compaction is set when there is a contention on > zone->lock resp. zone->lru_lock locks > > __alloc_pages_slowpath then backs of for THP allocation requests to > prevent from long stalls. This is rather messy and it would be much > cleaner to return a single compact result value and hide all the nasty > details into __alloc_pages_direct_compact. On the other hand, the nasty subtle details of THP allocation handling are now split between __alloc_pages_direct_compact and __alloc_pages_slowpath(). Lesser evil, I guess. I wish we could get rid of these special cases, now that latency of THP direct allocations is reduced by Mel's new defaults. > This patch shouldn't introduce any functional changes. > > Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka