]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2.6-3 cvs/fedora-glibc-2_6-3
authorJakub Jelinek <jakub@redhat.com>
Thu, 24 May 2007 10:33:02 +0000 (10:33 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 24 May 2007 10:33:02 +0000 (10:33 +0000)
ChangeLog
elf/dl-open.c
fedora/build-locale-archive.c
fedora/glibc.spec.in
nptl/ChangeLog
nptl/pthread_create.c

index 34b411dfca862d448841b0bbd9ece0de1ca3f39c..34814c46772161a9084665d9105a21049c2b023e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/dl-open.c (add_to_global): If the main searchlist is 256
+       entries or more, on each reallocation at least double the size
+       of the search list rather than growing it linearly.
+
 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/i386/epoll_pwait.S: New file.
index 583878781e2db086afceacf60d36cebd52a744bc..0afe94b5bf70d3e3960c3cdb4ce5cda991df0d60 100644 (file)
@@ -125,14 +125,18 @@ add_to_global (struct link_map *new)
     {
       /* We have to extend the existing array of link maps in the
         main map.  */
+      size_t new_size = ns->_ns_global_scope_alloc;
+      if (new_size >= 256 && new_size > to_add + 8)
+       new_size *= 2;
+      else
+       new_size += to_add + 8;
       new_global = (struct link_map **)
        realloc (ns->_ns_main_searchlist->r_list,
-                ((ns->_ns_global_scope_alloc + to_add + 8)
-                 * sizeof (struct link_map *)));
+                new_size * sizeof (struct link_map *));
       if (new_global == NULL)
        goto nomem;
 
-      ns->_ns_global_scope_alloc += to_add + 8;
+      ns->_ns_global_scope_alloc = new_size;
       ns->_ns_main_searchlist->r_list = new_global;
     }
 
index ef0ac91ba73cfaf457ffe3ac6b455f4d5d881f67..afe0cbdaae7ef0a07b4cc30558f4a34a5dc88fd7 100644 (file)
@@ -618,7 +618,7 @@ int main ()
   closedir (dirp);
   fill_archive (&tmpl_ah, cnt, list, primary);
   close_archive (&tmpl_ah);
-  unlink (tmpl_file);
+  truncate (tmpl_file, 0);
   char *argv[] = { "/usr/sbin/tzdata-update", NULL };
   execve (argv[0], (char *const *)argv, (char *const *)&argv[1]);
   exit (0);
index 201d0753ac3e5bc6396cd04447869353b8fc4ae3..18d04c886897abcb03528e52acfaffff386baeea 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 2
+%define glibcrelease 3
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define xenarches i686 athlon
 %ifarch %{xenarches}
@@ -1506,7 +1506,7 @@ rm -f *.filelist*
 %files -f common.filelist common
 %defattr(-,root,root)
 %dir %{_prefix}/lib/locale
-%attr(0644,root,root) %config(missingok) %{_prefix}/lib/locale/locale-archive.tmpl
+%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive.tmpl
 %attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive
 %dir %attr(755,root,root) /etc/default
 %verify(not md5 size mtime) %config(noreplace) /etc/default/nss
@@ -1561,6 +1561,12 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Thu May 24 2007 Jakub Jelinek <jakub@redhat.com> 2.6-3
+- don't use %%config(missingok) for locale-archive.tmpl,
+  instead of removing it altogether truncate it to zero
+  size (#240697)
+- add a workaround for #210748
+
 * Mon May 21 2007 Jakub Jelinek <jakub@redhat.com> 2.6-2
 - restore malloc_set_state backwards compatibility (#239344)
 - fix epoll_pwait (BZ#4525)
index 9b5ac1053e142b2eb5428e892632a284f953a74f..8ba39eafb9ad61be7cc1c3d54fa55a27fda864d0 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * pthread_create.c (__pthread_create_2_1): On the first pthread_create
+       in a process make sure main search list can store at least 256
+       entries.
+
 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #4512]
index 79729ced037fdce26f847f51a711a75a9d8f0ca7..22e8f018043924c330ae4b60edea02ed7b6dab89 100644 (file)
@@ -462,6 +462,30 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
   pd->flags = ((iattr->flags & ~(ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET))
               | (self->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)));
 
+  /* Hack: realloc the main search list on the first pthread_create call
+     to minimize the number of global search scope reallocations.
+     Wastes at most 1KB on 32-bit and 2KB on 64-bit per process
+     which calls pthread_create.  */
+  if (__builtin_expect (self->header.multiple_threads == 0, 0)
+      && GL(dl_ns)[0]._ns_main_searchlist
+      && GL(dl_ns)[0]._ns_main_searchlist->r_nlist < 256
+      && GL(dl_ns)[0]._ns_global_scope_alloc < 256)
+    {
+      struct link_map **new_global = (struct link_map **)
+       realloc (GL(dl_ns)[0]._ns_global_scope_alloc == 0
+                ? NULL : GL(dl_ns)[0]._ns_main_searchlist->r_list,
+                256 * sizeof (struct link_map *));
+      if (new_global != NULL)
+       {
+         if (GL(dl_ns)[0]._ns_global_scope_alloc == 0)
+           memcpy (new_global, GL(dl_ns)[0]._ns_main_searchlist->r_list,
+                   GL(dl_ns)[0]._ns_main_searchlist->r_nlist
+                   * sizeof (struct link_map *));
+         GL(dl_ns)[0]._ns_global_scope_alloc = 256;
+         GL(dl_ns)[0]._ns_main_searchlist->r_list = new_global;
+       }
+    }
+
   /* Initialize the field for the ID of the thread which is waiting
      for us.  This is a self-reference in case the thread is created
      detached.  */