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: Alistair Francis <alistair23 at gmail dot com>
- To: Arnd Bergmann <arnd at arndb dot de>
- Cc: Christian Brauner <christian at brauner dot io>, "Eric W. Biederman" <ebiederm at xmission dot com>, Rich Felker <dalias at libc dot org>, 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: Wed, 24 Jul 2019 17:04:53 -0700
- Subject: Re: [RFC v3 03/23] sysdeps/wait: Use waitid if avaliable
- References: <20190721040310.GA3283@brightrain.aerifal.cx> <CAK8P3a0bhS_d1SMyLQO_LDNvdgR+MKXmoESxWkrcz22mvjKcuw@mail.gmail.com> <87o91nbn37.fsf@xmission.com> <CAK8P3a3wgavtarKxSYJGL0ME9KRZ8UsUAZw+Y5J8WpG1GQ+=mw@mail.gmail.com> <87muh79yt2.fsf@xmission.com> <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>
On Tue, Jul 23, 2019 at 1:45 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Jul 23, 2019 at 10:29 AM Christian Brauner <christian@brauner.io> wrote:
> > On Tue, Jul 23, 2019 at 10:12:07AM +0200, Arnd Bergmann wrote:
> > > On Tue, Jul 23, 2019 at 2:01 AM Eric W. Biederman <ebiederm@xmission.com> wrote:
> > > > The BSDs implemented wait6 as their common wait that does everything
> > > > system call. It's large contribution is that wait6 will give both
> > > > the rusage of the child that exited and it's children separately.
> > >
> > > Ah right, that was one more thing I forgot on my earlier list. If we end up
> > > creating a new wait4()/waitid() replacement to replace the timeval
> > > with __kernel_timespec, we may want that to return a wrusage instead
> > > of rusage. Same for Christian's proposed pidfd_wait().
> >
> > So I'm in the middle of writing tests for pidfd_wait. And I'm currently
> > using struct rusage. I would suggest sending out a first version using
> > struct rusage and then you can point out what you would like see as a
> > replacement. What do you think, Arnd?
>
> 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.
Alistair
>
> Arnd