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

[commits] r2239 - in /fsf/trunk/libc: ./ include/ malloc/ nptl/ nptl/sysdeps/unix/sysv/linux/x86_64/



Author: eglibc
Date: Wed May 16 06:53:12 2007
New Revision: 2239

Log:
Import glibc-mainline for 2007-05-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/README
    fsf/trunk/libc/include/features.h
    fsf/trunk/libc/malloc/malloc.c
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/TODO
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
    fsf/trunk/libc/version.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed May 16 06:53:12 2007
@@ -1,3 +1,13 @@
+2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* version.h (VERSION): Define to 6.
+	* include/features.h (__GLIBC_MINOR__): Likewise.
+
+	* malloc/malloc.c: Use all small bin slots on 64-bit archs.
+
+	* malloc/malloc.c (largebin_index): Really have 32 buckets with 64
+	sizes.
+
 2007-05-13  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* malloc/malloc.c [MALLOC_DEBUG]: Keep track of current maximum

Modified: fsf/trunk/libc/README
==============================================================================
--- fsf/trunk/libc/README (original)
+++ fsf/trunk/libc/README Wed May 16 06:53:12 2007
@@ -1,4 +1,4 @@
-This directory contains the version 2.5 release of the GNU C Library.
+This directory contains the version 2.6 release of the GNU C Library.
 
 The GNU C Library is the standard system C library for all GNU systems,
 and is an important part of what makes up a GNU system.  It provides the
@@ -52,7 +52,7 @@
 
 The code for other CPU configurations supported by volunteers outside of
 the core glibc maintenance effort is contained in the separate `ports'
-add-on.  You can find glibc-ports-2.5 distributed separately in the
+add-on.  You can find glibc-ports-2.6 distributed separately in the
 same place where you got the main glibc distribution files.
 Currently these configurations are known to work using the `ports' add-on:
 

Modified: fsf/trunk/libc/include/features.h
==============================================================================
--- fsf/trunk/libc/include/features.h (original)
+++ fsf/trunk/libc/include/features.h Wed May 16 06:53:12 2007
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006
-	Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1995-2006,2007 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
@@ -304,7 +303,7 @@
 /* Major and minor version number of the GNU C library package.  Use
    these macros to test for features in specific releases.  */
 #define	__GLIBC__	2
-#define	__GLIBC_MINOR__	5
+#define	__GLIBC_MINOR__	6
 
 #define __GLIBC_PREREQ(maj, min) \
 	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))

Modified: fsf/trunk/libc/malloc/malloc.c
==============================================================================
--- fsf/trunk/libc/malloc/malloc.c (original)
+++ fsf/trunk/libc/malloc/malloc.c Wed May 16 06:53:12 2007
@@ -2125,21 +2125,36 @@
 
 #define NBINS             128
 #define NSMALLBINS         64
-#define SMALLBIN_WIDTH      8
-#define MIN_LARGE_SIZE    512
+#define SMALLBIN_WIDTH    MALLOC_ALIGNMENT
+#define MIN_LARGE_SIZE    (NSMALLBINS * SMALLBIN_WIDTH)
 
 #define in_smallbin_range(sz)  \
   ((unsigned long)(sz) < (unsigned long)MIN_LARGE_SIZE)
 
-#define smallbin_index(sz)     (((unsigned)(sz)) >> 3)
-
-#define largebin_index(sz)                                                   \
-(((((unsigned long)(sz)) >>  6) <= 32)?  56 + (((unsigned long)(sz)) >>  6): \
+#define smallbin_index(sz) \
+  (SMALLBIN_WIDTH == 16 ? (((unsigned)(sz)) >> 4) : (((unsigned)(sz)) >> 3))
+
+#define largebin_index_32(sz)                                                \
+(((((unsigned long)(sz)) >>  6) <= 38)?  56 + (((unsigned long)(sz)) >>  6): \
  ((((unsigned long)(sz)) >>  9) <= 20)?  91 + (((unsigned long)(sz)) >>  9): \
  ((((unsigned long)(sz)) >> 12) <= 10)? 110 + (((unsigned long)(sz)) >> 12): \
  ((((unsigned long)(sz)) >> 15) <=  4)? 119 + (((unsigned long)(sz)) >> 15): \
  ((((unsigned long)(sz)) >> 18) <=  2)? 124 + (((unsigned long)(sz)) >> 18): \
                                         126)
+
+// XXX It remains to be seen whether it is good to keep the widths of
+// XXX the buckets the same or whether it should be scaled by a factor
+// XXX of two as well.
+#define largebin_index_64(sz)                                                \
+(((((unsigned long)(sz)) >>  6) <= 48)?  48 + (((unsigned long)(sz)) >>  6): \
+ ((((unsigned long)(sz)) >>  9) <= 20)?  91 + (((unsigned long)(sz)) >>  9): \
+ ((((unsigned long)(sz)) >> 12) <= 10)? 110 + (((unsigned long)(sz)) >> 12): \
+ ((((unsigned long)(sz)) >> 15) <=  4)? 119 + (((unsigned long)(sz)) >> 15): \
+ ((((unsigned long)(sz)) >> 18) <=  2)? 124 + (((unsigned long)(sz)) >> 18): \
+                                        126)
+
+#define largebin_index(sz) \
+  (SIZE_SZ == 8 ? largebin_index_64 (sz) : largebin_index_32 (sz))
 
 #define bin_index(sz) \
  ((in_smallbin_range(sz)) ? smallbin_index(sz) : largebin_index(sz))

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Wed May 16 06:53:12 2007
@@ -1,3 +1,9 @@
+2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
+	extra cancellation test.
+	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
+
 2007-05-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* descr.h (struct pthread): Rearrange members to fill hole in

Modified: fsf/trunk/libc/nptl/TODO
==============================================================================
--- fsf/trunk/libc/nptl/TODO (original)
+++ fsf/trunk/libc/nptl/TODO Wed May 16 06:53:12 2007
@@ -14,3 +14,18 @@
 
 - test with threaded process terminating and semadj (?) being applied
   only after all threads are gone
+
+
+
+- semaphore changes:
+
+  - sem_post should only wake one thread and only when the state of
+    the semaphore changed from 0 to 1
+
+    this also requires that sem_wait and sem_timedwait don't drop the
+    post if they get canceled.
+
+  - possibly add counter field.  This requires reviving the
+    differences between old and new semaphose funtions.  The old ones
+    stay as they are now.  The new once can use an additional field
+    wich is the counter for the number of waiters

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S Wed May 16 06:53:12 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -40,12 +40,6 @@
 	.align	16
 	cfi_startproc
 sem_timedwait:
-	/* First check for cancellation.  */
-	movl	%fs:CANCELHANDLING, %eax
-	andl	$0xfffffff9, %eax
-	cmpl	$8, %eax
-	je	11f
-
 	movl	(%rdi), %eax
 2:	testl	%eax, %eax
 	je	1f
@@ -160,16 +154,5 @@
 
 	orl	$-1, %eax
 	jmp	10b
-	cfi_adjust_cfa_offset(-48)
-	cfi_restore(14)
-	cfi_restore(13)
-	cfi_restore(12)
-
-11:	/* Canceled.  */
-	movq	$0xffffffffffffffff, %fs:RESULT
-	LOCK
-	orl	$0x10, %fs:CANCELHANDLING
-	movq	%fs:CLEANUP_JMP_BUF, %rdi
-	jmp	HIDDEN_JUMPTARGET (__pthread_unwind)
 	cfi_endproc
 	.size	sem_timedwait,.-sem_timedwait

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S Wed May 16 06:53:12 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -37,12 +37,6 @@
 	.align	16
 	cfi_startproc
 sem_wait:
-	/* First check for cancellation.  */
-	movl	%fs:CANCELHANDLING, %eax
-	andl	$0xfffffff9, %eax
-	cmpl	$8, %eax
-	je	4f
-
 	pushq	%r12
 	cfi_adjust_cfa_offset(8)
 	cfi_offset(12, -16)
@@ -109,12 +103,5 @@
 	cfi_restore(12)
 
 	retq
-
-4:	/* Canceled.  */
-	movq	$0xffffffffffffffff, %fs:RESULT
-	LOCK
-	orl	$0x10, %fs:CANCELHANDLING
-	movq	%fs:CLEANUP_JMP_BUF, %rdi
-	jmp	HIDDEN_JUMPTARGET (__pthread_unwind)
 	cfi_endproc
 	.size	sem_wait,.-sem_wait

Modified: fsf/trunk/libc/version.h
==============================================================================
--- fsf/trunk/libc/version.h (original)
+++ fsf/trunk/libc/version.h Wed May 16 06:53:12 2007
@@ -1,4 +1,4 @@
 /* This file just defines the current version number of libc.  */
 
-#define RELEASE "development"
-#define VERSION "2.5.90"
+#define RELEASE "stable"
+#define VERSION "2.6"