[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140911150943.GD32722@krava.brq.redhat.com>
Date: Thu, 11 Sep 2014 17:09:43 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Borislav Petkov <bp@...e.de>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Jean Pihet <jean.pihet@...aro.org>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH] tools lib fd array: Do not set fd as non blocking evlist
On Wed, Sep 10, 2014 at 11:08:46AM -0300, Arnaldo Carvalho de Melo wrote:
SNIP
> +}
> +
> +void fdarray__exit(struct fdarray *fda)
> +{
> + free(fda->entries);
> + fdarray__init(fda, 0);
> +}
> +
> +void fdarray__delete(struct fdarray *fda)
> +{
> + fdarray__exit(fda);
> + free(fda);
> +}
> +
> +int fdarray__add(struct fdarray *fda, int fd, short revents)
> +{
> + if (fda->nr == fda->nr_alloc &&
> + fdarray__grow(fda, fda->nr_autogrow) < 0)
> + return -ENOMEM;
> +
> + fcntl(fd, F_SETFL, O_NONBLOCK);
also I spot this one and couldn't think of reason for it, attached
patch makes no behaviour difference for me..
I might be missing something, but I dont see any blocking operation
in perf related data reads. The git log history says it was there
since early days.
jirka
---
There's no reason for the current user of this API
to have non blocking fds. Also it should be up to
user to set this, not this object.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jean Pihet <jean.pihet@...aro.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/lib/api/fd/array.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/tools/lib/api/fd/array.c b/tools/lib/api/fd/array.c
index 3f6d1a0..0e636c4 100644
--- a/tools/lib/api/fd/array.c
+++ b/tools/lib/api/fd/array.c
@@ -78,7 +78,6 @@ int fdarray__add(struct fdarray *fda, int fd, short revents)
fdarray__grow(fda, fda->nr_autogrow) < 0)
return -ENOMEM;
- fcntl(fd, F_SETFL, O_NONBLOCK);
fda->entries[fda->nr].fd = fd;
fda->entries[fda->nr].events = revents;
fda->nr++;
--
1.7.7.6
--
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