On Thu, May 18, 2006 at 07:24:27AM +0300, Michael S. Tsirkin wrote:
> Quoting r. Gleb Natapov <[EMAIL PROTECTED]>:
> > @@ -187,8 +194,8 @@ int ibv_lock_range(void *base, size_t si
> >  
> >  
> >             if (node->refcnt++ == 0) {
> > -                   ret = mlock((void *) node->start,
> > -                               node->end - node->start + 1);
> > +                   ret = madvise((void *) node->start,
> > +                               node->end - node->start + 1, MADV_DONTFORK);
> >                     if (ret)
> >                             goto out;
> >             }
> 
> Will this break libibverbs on older kernels that don't have madvise?
> Maybe test MADV_DONTFORK during library startup and set a flag?
> 
madvise is always there, but older kernels will return EINVAL and we
don't check return value of ibv_lock_range() in ibv_reg_mr() so no harm is
done. It is possible to test for MADV_DONTFORK support during libibvervs
init and disable all madvise pathes if it is not available, but then we
will have two different configuration to test with no much gain.

--
                        Gleb.
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to