lkml.org 
[lkml]   [2014]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] perf: Allow ability to map cpus to nodes easily
On Mon, Mar 31, 2014 at 10:39:44PM -0400, Don Zickus wrote:
> 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.

well, if there's no need to call it extra then the function can do it

jirka


\
 
 \ /
  Last update: 2014-04-06 15:02    [W:0.084 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site