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: <AANLkTi=sDHEAMK0fWF07brEd6WEki0Sffmgcy3LkERK3@mail.gmail.com>
Date:	Fri, 18 Mar 2011 14:38:25 +0530
From:	Bharata B Rao <bharata.rao@...il.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Anton Blanchard <anton@....ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	Venkatesh Pallipadi <venki@...gle.com>,
	Paul Turner <pjt@...gle.com>, Mike Galbraith <efault@....de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Andreas Herrmann <andreas.herrmann3@....com>
Subject: Re: [RFC][PATCH 09/14] sched: Dynamically allocate
 sched_domain/sched_group data-structures

On Mon, Mar 14, 2011 at 8:36 PM, Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
>
>  enum s_alloc {
>        sa_rootdomain,
>        sa_sd,
> -       sa_tmpmask,
> +       sa_sd_storage,
>        sa_send_covered,
>        sa_nodemask,
>        sa_none,
>  };
>
>
>
>  SD_INIT_FUNC(CPU)
> @@ -7079,13 +6995,22 @@ static void set_domain_attribute(struct
>  static void __free_domain_allocs(struct s_data *d, enum s_alloc what,
>                                 const struct cpumask *cpu_map)
>  {
> +       int i, j;
> +
>        switch (what) {
>        case sa_rootdomain:
> -               free_rootdomain(d->rd); /* fall through */
> +               free_rootdomain(&d->rd->rcu); /* fall through */
>        case sa_sd:
>                free_percpu(d->sd); /* fall through */
> -       case sa_tmpmask:
> -               free_cpumask_var(d->tmpmask); /* fall through */
> +       case sa_sd_storage:
> +               for (i = 0; i < SD_LV_MAX; i++) {
> +                       for_each_cpu(j, cpu_map) {
> +                               kfree(*per_cpu_ptr(d->sdd[i].sd, j));
> +                               kfree(*per_cpu_ptr(d->sdd[i].sg, j));
> +                       }
> +                       free_percpu(d->sdd[i].sd);
> +                       free_percpu(d->sdd[i].sg);
> +               } /* fall through */
>        case sa_send_covered:
>                free_cpumask_var(d->send_covered); /* fall through */
>        case sa_nodemask:
> @@ -7098,25 +7023,70 @@ static void __free_domain_allocs(struct
>  static enum s_alloc __visit_domain_allocation_hell(struct s_data *d,
>                                                   const struct cpumask *cpu_map)
>  {
> +       int i, j;
> +
> +       memset(d, 0, sizeof(*d));
> +
>        if (!alloc_cpumask_var(&d->nodemask, GFP_KERNEL))
>                return sa_none;
>        if (!alloc_cpumask_var(&d->send_covered, GFP_KERNEL))
>                return sa_nodemask;
> -       if (!alloc_cpumask_var(&d->tmpmask, GFP_KERNEL))
> -               return sa_send_covered;

sa_send_covered enum member can be removed, since you no longer seem
to be using it.

Regards,
Bharata.
--
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