The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition
Date: Thu, 12 Mar 2009 00:37:09 -0700	[thread overview]
Message-ID: <20090312003709.1196ce15.akpm@linux-foundation.org> (raw)
In-Reply-To: <200903121745.23448.rusty@rustcorp.com.au>

On Thu, 12 Mar 2009 17:45:22 +1030 Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Thursday 12 March 2009 14:50:11 Nick Piggin wrote:
> > On Thursday 12 March 2009 15:06:52 Rusty Russell wrote:
> > > Rusty Russell (2):
> > >       cpumask: tsk_cpumask for accessing the struct task_struct's cpus_allowed.
> > >       cpumask: mm_cpumask for accessing the struct mm_struct's cpu_vm_mask.
> > >
> > >  include/linux/mm_types.h |    3 +++
> > >  include/linux/sched.h    |    3 +++

Please prefer to put the patches in the email if practical?  More
eyeballs and all that.

<goes fishing in linux-next>


: commit ccbc7af2a675bce8a9d4d3ab8e9c8a71a39d9158
: Author:     Rusty Russell <rusty@rustcorp.com.au>
: AuthorDate: Tue Mar 10 10:03:44 2009 +1100
: Commit:     Stephen Rothwell <sfr@canb.auug.org.au>
: CommitDate: Tue Mar 10 10:03:44 2009 +1100
: 
:     cpumask:task_cpumask
:     
:     This allows us to change the representation (to a dangling bitmap)
:     without breaking all the callers: they can use tsk_cpumask() now and
:     won't see a difference as the changes roll into linux-next.
:     
:     Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
: 
: diff --git a/include/linux/sched.h b/include/linux/sched.h
: index 8c216e0..011db2f 100644
: --- a/include/linux/sched.h
: +++ b/include/linux/sched.h
: @@ -1419,6 +1419,9 @@ struct task_struct {
:  #endif
:  };
:  
: +/* Future-safe accessor for struct task_struct's cpus_allowed. */
: +#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed)
: +
:  /*
:   * Priority of a process goes from 0..MAX_PRIO-1, valid RT
:   * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
: 
: 
: 
: commit 614e0176340928efb92cba676126048fdd466f0f
: Author:     Rusty Russell <rusty@rustcorp.com.au>
: AuthorDate: Tue Mar 10 10:03:44 2009 +1100
: Commit:     Stephen Rothwell <sfr@canb.auug.org.au>
: CommitDate: Tue Mar 10 10:03:44 2009 +1100
: 
:     cpumask:mm_cpumask
:     
:     This allows us to change the representation (to a dangling bitmap)
:     without breaking all the callers: they can use mm_cpumask() now and
:     won't see a difference as the changes roll into linux-next.
:     
:     Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
: 
: diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
: index 92915e8..d84feb7 100644
: --- a/include/linux/mm_types.h
: +++ b/include/linux/mm_types.h
: @@ -276,4 +276,7 @@ struct mm_struct {
:  #endif
:  };
:  
: +/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
: +#define mm_cpumask(mm) (&(mm)->cpu_vm_mask)
: +
:  #endif /* _LINUX_MM_TYPES_H */
: 


It would be pretty perverse to run tsk_cpumask() against a `struct
cpuset*', but your proposed implementation would merrily permit that
mistake.

Can we write the kernel in C please??


> And if the
> wrappers are in Linus' tree, it's easy to get the conversions into linux-next.

yup, the patches are quite safe and mergeable.  And if they'd been in the
email body, Linus might have seen that and pulled them ;)


  reply	other threads:[~2009-03-12  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12  4:06 [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition Rusty Russell
2009-03-12  4:20 ` Nick Piggin
2009-03-12  7:15   ` Rusty Russell
2009-03-12  7:37     ` Andrew Morton [this message]
2009-03-12  9:13       ` Rusty Russell
2009-03-12  9:24         ` Andrew Morton

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=20090312003709.1196ce15.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.org \
    /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