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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f11576a0802111025w4f8d6765w119f9e9c1cddd85e@mail.gmail.com>
Date:	Tue, 12 Feb 2008 03:25:15 +0900
From:	"KOSAKI Motohiro" <kosaki.motohiro@...fujitsu.com>
To:	"David Rientjes" <rientjes@...gle.com>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Paul Jackson" <pj@....com>,
	"Christoph Lameter" <clameter@....com>,
	"Lee Schermerhorn" <Lee.Schermerhorn@...com>,
	"Andi Kleen" <ak@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [patch 3/4] mempolicy: add MPOL_F_STATIC_NODES flag

Hi David,

In general, I like this feature.
and I found no bug in patch [1/4] and [2/4].

> @@ -218,21 +167,27 @@ static struct mempolicy *mpol_new(enum mempolicy_mode mode,
>                 return ERR_PTR(-ENOMEM);
>         flags &= MPOL_MODE_FLAGS;
>         atomic_set(&policy->refcnt, 1);
> +       cpuset_update_task_memory_state();
> +       nodes_and(cpuset_context_nmask, *nodes, cpuset_current_mems_allowed);
>         switch (mode) {
>         case MPOL_INTERLEAVE:
> -               policy->v.nodes = *nodes;
> +               if (nodes_empty(*nodes))
> +                       return ERR_PTR(-EINVAL);

need kmem_cache_free(policy_cache, policy) before return?

> +               policy->v.nodes = cpuset_context_nmask;
>                 if (nodes_weight(policy->v.nodes) == 0) {
>                         kmem_cache_free(policy_cache, policy);
>                         return ERR_PTR(-EINVAL);
>                 }
>                 break;
>         case MPOL_PREFERRED:
> -               policy->v.preferred_node = first_node(*nodes);
> +               policy->v.preferred_node = first_node(cpuset_context_nmask);
>                 if (policy->v.preferred_node >= MAX_NUMNODES)
>                         policy->v.preferred_node = -1;
>                 break;
>         case MPOL_BIND:
> -               policy->v.zonelist = bind_zonelist(nodes);
> +               if (nodes_empty(*nodes))
> +                       return ERR_PTR(-EINVAL);

ditto

Thanks!
--
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