This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v3 03/23] sysdeps/wait: Use waitid if avaliable
- From: Christian Brauner <christian at brauner dot io>
- To: Arnd Bergmann <arnd at arndb dot de>
- Cc: Rich Felker <dalias at libc dot org>, Alistair Francis <alistair23 at gmail dot com>, "Eric W. Biederman" <ebiederm at xmission dot com>, Linus Torvalds <torvalds at linux-foundation dot org>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Palmer Dabbelt <palmer at sifive dot com>, macro at wdc dot com, Zong Li <zongbox at gmail dot com>, Andrew Morton <akpm at linux-foundation dot org>, Al Viro <viro at zeniv dot linux dot org dot uk>, "H. Peter Anvin" <hpa at zytor dot com>
- Date: Thu, 25 Jul 2019 18:06:02 +0200
- Subject: Re: [RFC v3 03/23] sysdeps/wait: Use waitid if avaliable
- References: <CAHk-=wjtGaJFceL+YB6=mTxQCvyNvBTavqgGTm-d5FA9xLQ0Cw@mail.gmail.com> <87blxn83sk.fsf@xmission.com> <20190721232336.GA30851@brightrain.aerifal.cx> <87k1c962ml.fsf@xmission.com> <CAK8P3a0jOO8dDK+w0N_RvgUHiW7=i_ak9AyFvH61wqUusL3Drw@mail.gmail.com> <20190723082857.kf2go2vfvnu7q7zd@brauner.io> <CAK8P3a26KBRvJHyWkK0J8FGXQn4jHL2QG10oBGSLidG95xQxrw@mail.gmail.com> <CAKmqyKOXJxJq5-ktLc=oY7ooNj6-X9PotHNM=-xG95iPCAAmjQ@mail.gmail.com> <20190725044009.GJ1506@brightrain.aerifal.cx> <CAK8P3a1pjB8SMFQK0MUom0m5fCSAdVZFtJyeUkCLW-u-RHC3oA@mail.gmail.com>
On Thu, Jul 25, 2019 at 03:15:35PM +0200, Arnd Bergmann wrote:
> On Thu, Jul 25, 2019 at 6:40 AM Rich Felker <dalias@libc.org> wrote:
> > On Wed, Jul 24, 2019 at 05:04:53PM -0700, Alistair Francis wrote:
> > > On Tue, Jul 23, 2019 at 1:45 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > >
> > > > Sounds good to me, the debate over what rusage to use should not hold
> > > > up the review of the rest of that syscall.
> > >
> > > I'm unclear what the final decision is here. What is the solution are
> > > we going to have wait4() or add P_PROCESS_PGID to waitid()?
> > >
> > > As well as that what is the solution to current implementations? If we
> > > add wait4() then there isn't an issue (and I can drop this patch) but
> > > if we add P_PROCESS_PGID then we will need a way to handle kernels
> > > with waitid() but no P_PROCESS_PGID. Although my new plan is to only
> > > use the waitid syscall if we don't have waitpid or wait4 so it seems
> > > like this will only affect RV32 for the time being.
> >
> > I would really like some indication which solution will be taken,
> > since it impacts choices that will need to be made in musl very soon.
> > My favorite outcome would be bringing back wait4 for rv32 (and
> > no-time32 archs in general) *and* adding P_PROCESS_PGID. In the short
> > term, just using wait4 would be the simplest and cleanest for us (same
> > as all other archs, no extra case to deal with), but in the long term
> > there may be value in having rusage that can represent more than 68
> > cpu-years spent by a process (seems plausible with large numbers of
> > cores).
>
> Based on the feedback from Linus and Eric, the most likely outcome
> at the moment seems to be an extension of waitid() to allow
> P_PGID with id=0 like BSD does, and not bring back wait4() or
> add P_PROCESS_PGID.
>
> So far, I don't think anyone has proposed an actual kernel patch.
> I was hoping that Eric would do it, but I could also send it if he's
> otherwise busy.
I'm touching waitid() right now. I can pick this up and put this in
there too.
Christian