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]
Date:	Mon, 12 Jan 2015 08:31:45 -0500
From:	Tejun Heo <tj@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 10/12] sched: use {cpu|node}mask pr_cont and seq output
 functions

Hello, Peter.

On Mon, Dec 15, 2014 at 11:39:15AM +0100, Peter Zijlstra wrote:
> I would very much prefer something like the below instead..
> 
> I'm not a great fan of pr_cont, it makes a mess of things if there's
> multiple cpus printing bits.

Yeah, it does sometimes get annoying and bitmaps should be generic
enough to have support from core printk functions.

...
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -27,6 +27,7 @@
>  #include <linux/uaccess.h>
>  #include <linux/ioport.h>
>  #include <linux/dcache.h>
> +#include <linux/cpumask.h>
>  #include <net/addrconf.h>
>  
>  #include <asm/page.h>		/* for PAGE_SIZE */
> @@ -1218,6 +1219,7 @@ int kptr_restrict __read_mostly;
>   *            The maximum supported length is 64 bytes of the input. Consider
>   *            to use print_hex_dump() for the larger input.
>   * - 'a' For a phys_addr_t type and its derivative types (passed by reference)
> + * - 'c' For a cpumask list
>   *
>   * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
>   * function pointers are really function descriptors, which contain a
> @@ -1335,6 +1337,8 @@ char *pointer(const char *fmt, char *buf
>  		return dentry_name(buf, end,
>  				   ((const struct file *)ptr)->f_path.dentry,
>  				   spec, fmt);
> +	case 'c':
> +		return buf + cpulist_scnprintf(buf, end - buf, ptr);

I think we prolly want something more generic than hard coding cpu and
node masks into printk.  Prolly something along the line of %*pb so
that the caller can do something along the line of

  printk("cpumask: %*pb\n", nr_cpumask_bits, cpumask);

I'll see if that's actually doable.

Thanks.

-- 
tejun
--
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