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, 28 Oct 2019 19:14:19 -0700
From:   Andi Kleen <ak@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Andi Kleen <andi@...stfloor.org>, acme@...nel.org,
        jolsa@...nel.org, eranian@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/7] perf pmu: Use file system cache to optimize sysfs
 access

On Mon, Oct 28, 2019 at 11:01:37PM +0100, Jiri Olsa wrote:
> On Fri, Oct 25, 2019 at 11:14:11AM -0700, Andi Kleen wrote:
> 
> SNIP
> 
> >  	if (pmu_aliases_parse(path, head))
> >  		return -1;
> > @@ -525,7 +524,6 @@ static int pmu_alias_terms(struct perf_pmu_alias *alias,
> >   */
> >  static int pmu_type(const char *name, __u32 *type)
> >  {
> > -	struct stat st;
> >  	char path[PATH_MAX];
> >  	FILE *file;
> >  	int ret = 0;
> > @@ -537,7 +535,7 @@ static int pmu_type(const char *name, __u32 *type)
> >  	snprintf(path, PATH_MAX,
> >  		 "%s" EVENT_SOURCE_DEVICE_PATH "%s/type", sysfs, name);
> >  
> > -	if (stat(path, &st) < 0)
> > +	if (access(path, R_OK) < 0)
> 
> why not file_available call in here?

iirc it doesn't do any redundant accesses.

-Andi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ