[CRIU] [PATCH 02/11] lazy-pages: always compile uffd.c

Mike Rapoport rppt at linux.vnet.ibm.com
Sun Apr 17 00:10:43 PDT 2016


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.
 
> 		Adrian

--
Sincerely yours,
Mike.



More information about the CRIU mailing list