From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] Fix running failure when > 69 CPUs for open file limitation
Date: Tue, 04 Jun 2013 13:19:20 +0300 [thread overview]
Message-ID: <20130604101920.GA2323@swordfish> (raw)
In-Reply-To: 20130604212236.GA14821@linux-youquan.bj.intel.com
[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]
On (06/04/13 17:22), Youquan Song wrote:
> >
> > Hello,
> > I'd like to ask you to try out the following patch. We leak fd in read_file().
> >
>
> No. below patch does not fix the issue. The issue happen at open too
> many files at beginning.
>
Well, the patch is a separate issue not addressing the rlimit problem directly.
We just leak fd in read_file().
-ss
> Thanks
> -Youquan
>
>
> >
> >
> > ------8<--------8<--------
> >
> > - Do not leak file descriptor in perf_bundle read_file().
> > - Clear perf event (unmap memory and close fd) on event destruction.
> >
> >
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
> >
> > ---
> >
> > diff --git a/src/perf/perf.cpp b/src/perf/perf.cpp
> > index 35b4017..e919741 100644
> > --- a/src/perf/perf.cpp
> > +++ b/src/perf/perf.cpp
> > @@ -167,6 +167,7 @@ perf_event::~perf_event(void)
> > if (perf_event::pevent->ref_count == 1) {
> > pevent_free(perf_event::pevent);
> > perf_event::pevent = NULL;
> > + clear();
> > } else
> > pevent_unref(perf_event::pevent);
> > }
> > diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
> > index 38e1e91..8d480e8 100644
> > --- a/src/perf/perf_bundle.cpp
> > +++ b/src/perf/perf_bundle.cpp
> > @@ -123,6 +123,7 @@ static char * read_file(const char *file)
> > buffer[len] = '\0';
> > }
> > out:
> > + close(fd);
> > return buffer;
> > }
> >
> >
>
next reply other threads:[~2013-06-04 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 10:19 Sergey Senozhatsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-06-04 10:26 [Powertop] [PATCH] Fix running failure when > 69 CPUs for open file limitation Sergey Senozhatsky
2013-05-29 21:20 Sergey Senozhatsky
2013-05-29 21:00 Sergey Senozhatsky
2013-05-29 15:44 Youquan Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130604101920.GA2323@swordfish \
--to=powertop@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.