[PATCH 0/3] x86: add cpuset_scnprintf function

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, <linux-kernel@...>, Paul Jackson <pj@...>
Date: Tuesday, April 1, 2008 - 6:54 pm

*  Add a new cpuset_scnprintf and a sysctl flag to control how cpumask sets
   are printed.  The default is to use the current cpumask_scnprintf.  If
   kernel.compat_cpuset_printf is '0' (default 1), then cpulist_scnprintf
   is used.  In addition, a nodeset_scnprintf is provided for compatibilty.

   This is introduced with a CONFIG_KERN_COMPAT_CPUSET_PRINTF flag which
   currently is only defined for X86_64_SMP architecture.  For all other
   architectures the current cpumask_scnprintf() is used.

*  Modify usages of cpumask_scnprintf to use the new cpuset_scnprintf where
   appropriate.  The list of files affected are:

	arch/x86/kernel/cpu/intel_cacheinfo.c
	drivers/base/node.c
	drivers/base/topology.c
	drivers/pci/pci-sysfs.c
	drivers/pci/probe.c
	kernel/irq/proc.c
	kernel/profile.c
	kernel/sched_stats.h
	kernel/sysctl.c
	kernel/sysctl_check.c
	kernel/trace/trace.c

Note that kernel/sched.c is not in this patchset as it has many other changes,
so the change to use cpuset_scnprintf is in another patchset.

For inclusion in x86/latest.

Based on:
	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    +   x86/latest          .../x86/linux-2.6-x86.git
    +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git

Cc: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Mike Travis <travis@sgi.com>
---

The discussion that led up to this...

On Fri, Mar 28, 2008 at 3:40 PM, Mike Travis <travis@sgi.com> wrote:
...
But you can declare it as a programming error on user space side. If
you change the format, the brown-paper-bag is yours.


On Mon, Mar 31, 2008 at 6:35 PM, Mike Travis <travis@sgi.com> wrote:
I ask myself, why is there a temporary buffer allocation in the first
place? In the end it is copied unbounded into the provided buf
argument. Sure your list is mostly shorter than a hex mask, but you
can also not be sure that it fit into the provided buffer. So you can
also use cpumask_scnprintf directly with the buf argument, and provide
a good known upper bound for the size (ie.
cpumask_scnprintf_len(nr_cpu_ids)).

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] x86: add cpuset_scnprintf function, Mike Travis, (Tue Apr 1, 6:54 pm)
Re: [PATCH 0/3] x86: add cpuset_scnprintf function, Paul Jackson, (Wed Apr 2, 2:20 am)
Re: [PATCH 0/3] x86: add cpuset_scnprintf function, Mike Travis, (Wed Apr 2, 10:36 am)
Re: [PATCH 0/3] x86: add cpuset_scnprintf function, Paul Jackson, (Wed Apr 2, 11:28 am)
Re: [PATCH 0/3] x86: add cpuset_scnprintf function, Mike Travis, (Wed Apr 2, 3:47 am)
Re: [PATCH 0/3] x86: add cpuset_scnprintf function, Paul Jackson, (Wed Apr 2, 6:39 am)