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, 31 Mar 2014 22:39:44 -0400
From:	Don Zickus <dzickus@...hat.com>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	acme@...stprotocols.net, LKML <linux-kernel@...r.kernel.org>,
	jmario@...hat.com, fowles@...each.com
Subject: Re: [PATCH 1/4] perf: Allow ability to map cpus to nodes easily

On Sat, Mar 29, 2014 at 06:10:33PM +0100, Jiri Olsa wrote:
> > +/* Determine highest possible node in the system for sparse allocation */
> > +static void set_max_node_num(void)
> > +{
> > +	FILE *fp;
> > +	int ret = -1;
> > +
> > +	/* set up default */
> > +	max_node_num = 8;
> > +
> > +	/* get the highest possible cpu number for a sparse allocation */
> > +	fp = fopen("/sys/devices/system/node/possible", "r");
> > +	if (!fp)
> > +		goto out;
> 
> any reason why not put fopen/fclose into __set_max_num ?

I either had to pass in a path string pointer or a file pointer, I just
chose a file pointer.  Thought it fit with the rest of perf passing FPs
around. :-D  It doesn't matter to me either way.

> 
> also looks like 'get_max_num' would fit better for __set_max_num ;-)

Yeah, I split it out based on your suggestion and didn't realize the
details kinda changed.

Cheers,
Don

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