Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753953AbbGNWwz (ORCPT ); Tue, 14 Jul 2015 18:52:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44110 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbbGNWww (ORCPT ); Tue, 14 Jul 2015 18:52:52 -0400 Date: Tue, 14 Jul 2015 15:52:51 -0700 From: Andrew Morton To: David Rientjes Cc: Sergey Senozhatsky , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v3 1/3] mm, oom: organize oom context into struct Message-Id: <20150714155251.ddb7ef5a54b3b1f49d5fc968@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1544 Lines: 46 On Wed, 8 Jul 2015 16:42:42 -0700 (PDT) David Rientjes wrote: > There are essential elements to an oom context that are passed around to > multiple functions. > > Organize these elements into a new struct, struct oom_control, that > specifies the context for an oom condition. > > This patch introduces no functional change. > > ... > > --- a/include/linux/oom.h > +++ b/include/linux/oom.h > @@ -12,6 +12,14 @@ struct notifier_block; > struct mem_cgroup; > struct task_struct; > > +struct oom_control { > + struct zonelist *zonelist; > + nodemask_t *nodemask; > + gfp_t gfp_mask; > + int order; > + bool force_kill; > +}; Some docs would be nice. gfp_mask and order are what the page-allocating caller originally asked for, I think? They haven't been mucked with? It's somewhat obvious what force_kill does, but why is it provided, why is it set? And what does it actually kill? A process which was selected based on the other fields... Also, it's a bit odd that zonelist and nodemask are here. They're low-level implementation details whereas the other three fields are high-level caller control stuff. Anyway, please have a think about it. The definition site for a controlling structure can be a great place to reveal the overall design and operation. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/