[CRIU] [PATCH 02/11] lazy-pages: always compile uffd.c
Adrian Reber
areber at redhat.com
Sun Apr 17 02:43:55 PDT 2016
On Sun, Apr 17, 2016 at 10:10:43AM +0300, Mike Rapoport wrote:
> On Thu, Apr 14, 2016 at 04:41:39PM +0200, Adrian Reber wrote:
> > On Wed, Apr 13, 2016 at 01:16:53PM +0300, Mike Rapoport wrote:
> > > On Wed, Apr 13, 2016 at 10:08:14AM +0200, Adrian Reber wrote:
> > > > Instead of adding ifdef's around the whole uffd.c content why didn't you
> > > > add your cr_lazy_pages()-without-UFFD implementation in the header file.
> > > >
> > > > This would keep uffd.c free of ifdef's and should work just the way this
> > > > patch tries to implement it.
> > >
> > > The #ifdef's in the .c file come instead ifeq ($(UFFD),1) in the Makefile.
> > > If the uffd.c is always compiled, it will produce errors on systems that do
> > > not have kernel headers recent enough.
> >
> > Yes, but why is it necessary to always compile uffd.c? Is 'ifeq ($(UFFD),1)'
> > something negative which should be avoided?
>
> Nothing negative, it's just my personal preference. Actually, I'd go even
> further, and add UFFD to FEATURE list and remove it from other places in
> the Makefiles. In perspective it'll allow to build uffd.c even on the
> systems with old kernel headers and then detect presence of userfaultfd
> system call in runtime.
It used to be part of the FEATURE list, but the FEATURE list does not
export its results to the Makefiles. That's why the UFFD check is not
part of the FEATURE list. So my personal preference is to keep the
#ifdef's in the header file instead of uffd.c. So it seems our personal
preferences are different regarding this patch and maybe Pavel can
decide what fits better into the existing codebase.
Adrian
More information about the CRIU
mailing list