From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbcEDOj0 (ORCPT ); Wed, 4 May 2016 10:39:26 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:35953 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753255AbcEDOjQ (ORCPT ); Wed, 4 May 2016 10:39:16 -0400 MIME-Version: 1.0 In-Reply-To: <20160504085307.GD29978@dhcp22.suse.cz> References: <1461181647-8039-1-git-send-email-mhocko@kernel.org> <1461181647-8039-13-git-send-email-mhocko@kernel.org> <20160504060123.GB10899@js1304-P5Q-DELUXE> <20160504085307.GD29978@dhcp22.suse.cz> Date: Wed, 4 May 2016 23:39:14 +0900 Message-ID: Subject: Re: [PATCH 12/14] mm, oom: protect !costly allocations some more From: Joonsoo Kim To: Michal Hocko Cc: Joonsoo Kim , Andrew Morton , Linus Torvalds , Johannes Weiner , Mel Gorman , David Rientjes , Tetsuo Handa , Hillf Danton , Vlastimil Babka , Linux Memory Management List , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-05-04 17:53 GMT+09:00 Michal Hocko : > On Wed 04-05-16 15:01:24, Joonsoo Kim wrote: >> On Wed, Apr 20, 2016 at 03:47:25PM -0400, Michal Hocko wrote: > [...] > > Please try to trim your responses it makes it much easier to follow the > discussion Okay. >> > +static inline bool >> > +should_compact_retry(unsigned int order, enum compact_result compact_result, >> > + enum migrate_mode *migrate_mode, >> > + int compaction_retries) >> > +{ >> > + if (!order) >> > + return false; >> > + >> > + /* >> > + * compaction considers all the zone as desperately out of memory >> > + * so it doesn't really make much sense to retry except when the >> > + * failure could be caused by weak migration mode. >> > + */ >> > + if (compaction_failed(compact_result)) { >> >> IIUC, this compaction_failed() means that at least one zone is >> compacted and failed. This is not same with your assumption in the >> comment. If compaction is done and failed on ZONE_DMA, it would be >> premature decision. > > Not really, because if other zones are making some progress then their > result will override COMPACT_COMPLETE Think about the situation that DMA zone fails to compact and the other zones are deferred or skipped. In this case, COMPACT_COMPLETE will be returned as a final result and should_compact_retry() return false. I don't think that it means all the zones are desperately out of memory. Thanks.