On Thu, 28 Apr 2016 12:49:45 +0300 Ian Ray <ian....@ge.com> wrote: > Block signals during the call to posix_fallocate, because that api does > an explicit rollback if it gets EINTR and on slow systems (particularly > with large allocation sizes) the smart scheduler's SIGALRM will prevent > posix_fallocate from ever successfully completing. > > Signed-off-by: Ian Ray <ian....@ge.com> > --- > hw/xwayland/xwayland-shm.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c > index c199e5e..4133a7d 100644 > --- a/hw/xwayland/xwayland-shm.c > +++ b/hw/xwayland/xwayland-shm.c > @@ -28,6 +28,8 @@ > #include <dix-config.h> > #endif > > +#include "os.h" > + > #include "xwayland.h" > > #include <sys/mman.h> > @@ -140,9 +142,11 @@ os_create_anonymous_file(off_t size) > return -1; > > #ifdef HAVE_POSIX_FALLOCATE > + OsBlockSignals(); > do { > ret = posix_fallocate(fd, 0, size); > } while (ret == EINTR); > + OsReleaseSignals(); > > if (ret != 0) { > close(fd);
Acked-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> I'll leave it to the X developers to check the code is actually correct. This might warrant a nice comment in the code too, to explain what is going on. Thanks, pq
pgp5EfE3KzGcu.pgp
Description: OpenPGP digital signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel