bug-hurd
[Top][All Lists]
Advanced

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

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


From: Agustina Arzille
Subject: Re: [ PATCH ] Replace glibc spin-locks with gsync-based locks
Date: Fri, 06 May 2016 23:19:20 -0300

Hello, Samuel

On 05/06/2016 10:36 AM, Samuel Thibault wrote:

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 run it with "kvm -m 512 -hda debian-hurd-20160325.img", because I had heard
mixed things about writeback cache. I'll try a build again with that option.
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
endif

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.

That's much better. Thanks.

+#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
should.

Well, in mach/gnumach.h, there's only the prototypes. I'm not exactly sure on
how to export constants defined in a kernel file. Or maybe I missed a flag when
installing the kernel...


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 :)

Good catch. It's been fixed now.


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

Samuel

I have, but only rudimentary tests, because I could never make it past glibc's
test suite, due to the filesystem consistently freezing at that point. I admit
to being rather impatient, but after waiting several minutes on a single test,
and when Ctrl+C does nothing, I just assumed the filesystem had deadlocked.

The updated patch is attached.

Attachment: glibc.diff
Description: Text Data


reply via email to

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