lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070921200026.GD1857@martell.zuzino.mipt.ru>
Date:	Sat, 22 Sep 2007 00:00:26 +0400
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	rientjes@...gle.com, andrea@...e.de, clameter@....com,
	akpm@...l.org
Subject: Re: + oom-move-constraints-to-enum.patch added to -mm tree

On Fri, Sep 21, 2007 at 02:10:57AM -0700, akpm@...ux-foundation.org wrote:
> The OOM killer's CONSTRAINT definitions are really more appropriate in an
> enum, so define them in include/linux/oom.h.

OK with enum, but this series do not bring user outside of
mm/oom_kill.c, so why move them to header.

> --- a/include/linux/oom.h~oom-move-constraints-to-enum
> +++ a/include/linux/oom.h
> @@ -11,6 +11,15 @@
>  
>  #ifdef __KERNEL__
>  
> +/*
> + * Types of limitations to the nodes from which allocations may occur
> + */
> +enum oom_constraint {
> +	CONSTRAINT_NONE,
> +	CONSTRAINT_CPUSET,
> +	CONSTRAINT_MEMORY_POLICY,
> +};
> +
>  extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
>  extern int register_oom_notifier(struct notifier_block *nb);
>  extern int unregister_oom_notifier(struct notifier_block *nb);
> diff -puN mm/oom_kill.c~oom-move-constraints-to-enum mm/oom_kill.c
> --- a/mm/oom_kill.c~oom-move-constraints-to-enum
> +++ a/mm/oom_kill.c
> @@ -164,16 +164,10 @@ unsigned long badness(struct task_struct
>  }
>  
>  /*
> - * Types of limitations to the nodes from which allocations may occur
> - */
> -#define CONSTRAINT_NONE 1
> -#define CONSTRAINT_MEMORY_POLICY 2
> -#define CONSTRAINT_CPUSET 3
> -
> -/*
>   * Determine the type of allocation constraint.
>   */
> -static inline int constrained_alloc(struct zonelist *zonelist, gfp_t gfp_mask)
> +static inline enum oom_constraint constrained_alloc(struct zonelist *zonelist,
> +						    gfp_t gfp_mask)
>  {
>  #ifdef CONFIG_NUMA
>  	struct zone **z;
> @@ -393,7 +387,7 @@ void out_of_memory(struct zonelist *zone
>  	struct task_struct *p;
>  	unsigned long points = 0;
>  	unsigned long freed = 0;
> -	int constraint;
> +	enum oom_constraint constraint;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ