From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: Re: [patch 07/12] mm: page_alloc: inline should_alloc_retry() Date: Thu, 26 Mar 2015 11:18:30 -0400 Message-ID: <20150326151830.GD23973@cmpxchg.org> References: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> <1427264236-17249-8-git-send-email-hannes@cmpxchg.org> <20150326141128.GL15257@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Tetsuo Handa , Huang Ying , Andrea Arcangeli , Dave Chinner , Theodore Ts'o To: Michal Hocko Return-path: Content-Disposition: inline In-Reply-To: <20150326141128.GL15257@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Mar 26, 2015 at 03:11:28PM +0100, Michal Hocko wrote: > On Wed 25-03-15 02:17:11, Johannes Weiner wrote: > > The should_alloc_retry() function was meant to encapsulate retry > > conditions of the allocator slowpath, but there are still checks > > remaining in the main function, and much of how the retrying is > > performed also depends on the OOM killer progress. The physical > > separation of those conditions make the code hard to follow. > > > > Inline the should_alloc_retry() checks. Notes: > > > > - The __GFP_NOFAIL check is already done in __alloc_pages_may_oom(), > > replace it with looping on OOM killer progress > > > > - The pm_suspended_storage() check is meant to skip the OOM killer > > when reclaim has no IO available, move to __alloc_pages_may_oom() > > > > - The order < PAGE_ALLOC_COSTLY order is re-united with its original > > counterpart of checking whether reclaim actually made any progress > > it should be order <= PAGE_ALLOC_COSTLY Oops, thanks for catching that. I'll fix it in v2. > > Signed-off-by: Johannes Weiner > > The resulting code looks much better and logical. > > After the COSTLY check is fixed. > Acked-by: Michal Hocko Thank you