[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ PATCH ] Replace glibc spin-locks with gsync-based locks

From: Samuel Thibault
Subject: Re: [ PATCH ] Replace glibc spin-locks with gsync-based locks
Date: Fri, 6 May 2016 15:36:11 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)


Agustina Arzille, on Thu 05 May 2016 23:02:35 -0300, wrote:
> Here's the first of the patches to replace spin-locks in glibc with locks 
> based
> on gnumach's gsync.

Cool :)

> I ran into a lot of troubles to compile glibc, mostly because the filesystem
> kept freezing and / or crashing.

That's worrying, and surprising to me since buildds keep building stuff
for days without too many issues.  How are you running your Hurd system?
I usually run with kvm -drive cache=writeback

> I had to modify several makefiles for a few libs because the new locks use 
> RPCs
> that are implemented in libmachuser. This is strictly for gnumach, obviously,
> so it should be probably be edited out for other platforms (Linux), or be
> included as a patch in Debian's package. Any help with this will be greatly
> appreciated :)

See how this is done in sysdeps/mach/hurd/Makefile for instance:

ifeq ($(subdirs),sunrpc)
sysdep_headers += nfs/nfs.h

You can add similar lines in sysdeps/mach/Makefile (since that's
Mach-specific but not Hurd-specific) to add the -lmachuser flag to
LDLIBS-crypt.so etc.

> +#ifndef __MACH_LOWLEVELLOCK_H__
> +#define __MACH_LOWLEVELLOCK_H__   1
> +
> +#include <mach/gnumach.h>
> +#include <atomic.h>
> +
> +/* Gsync flags. */
> +#define GSYNC_SHARED      0x01
> +#define GSYNC_QUAD        0x02
> +#define GSYNC_TIMED       0x04
> +#define GSYNC_BROADCAST   0x08
> +#define GSYNC_MUTATE      0x10

Don't we install a mach header to define these?  If not yet, we really

> diff --git a/mach/spin-lock.h b/mach/spin-lock.h
> index fc21b1e..535191a 100644
> --- a/mach/spin-lock.h
> +++ b/mach/spin-lock.h
> @@ -1,5 +1,5 @@
>  /* Definitions of user-visible names for spin locks.
> -   Copyright (C) 1994-2014 Free Software Foundation, Inc.
> +   Copyright (C) 1994-2016 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
>     The GNU C Library is free software; you can redistribute it and/or

Take care, this wasn't actually modified :)

That's it for now with a quick review, it looks good and not intrusive
overall.  I guess you have tested it ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]