mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul Menage" <menage@google.com>
To: "Lai Jiangshan" <laijs@cn.fujitsu.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Paul Jackson" <pj@sgi.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] cpuset: two minor code-cleanups
Date: Wed, 16 Jul 2008 00:21:20 -0700	[thread overview]
Message-ID: <6599ad830807160021n2d09a7c3mfc3122e7be768db5@mail.gmail.com> (raw)
In-Reply-To: <487D6E51.1000907@cn.fujitsu.com>

On Tue, Jul 15, 2008 at 8:43 PM, Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
> in function cpuset_update_task_memory_state()
> local variable
> struct task_struct *tsk = current;
>
> and local variable tsk is used 14 times and
> statement task_cs(tsk) is used twice in this function.
> So using task_cs(tsk) instead of task_cs(current) is
> better for readability.
>
> And "(struct cgroup_scanner *)&scan" is not good for
> readability also. (and "container_of" is used in cpuset_do_move_task(),
> not "(cpuset_hotplug_scanner *)scan")
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>

Acked-by: Paul Menage <menage@google.com>

Thanks.

> ---
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 798b3ab..4513deb 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -369,7 +369,7 @@ void cpuset_update_task_memory_state(void)
>                my_cpusets_mem_gen = top_cpuset.mems_generation;
>        } else {
>                rcu_read_lock();
> -               my_cpusets_mem_gen = task_cs(current)->mems_generation;
> +               my_cpusets_mem_gen = task_cs(tsk)->mems_generation;
>                rcu_read_unlock();
>        }
>
> @@ -1778,7 +1778,7 @@ static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to)
>        scan.scan.heap = NULL;
>        scan.to = to->css.cgroup;
>
> -       if (cgroup_scan_tasks((struct cgroup_scanner *)&scan))
> +       if (cgroup_scan_tasks(&scan.scan))
>                printk(KERN_ERR "move_member_tasks_to_cpuset: "
>                                "cgroup_scan_tasks failed\n");
>  }
>
>
>
>
>
>

      reply	other threads:[~2008-07-16  7:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16  3:43 Lai Jiangshan
2008-07-16  7:21 ` Paul Menage [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6599ad830807160021n2d09a7c3mfc3122e7be768db5@mail.gmail.com \
    --to=menage@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®