ALT Linux Bugzilla
– Attachment 2402 Details for
Bug 14264
Вызов posix_fadvise в ld.so
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Сам патч
glibc-2.3.90-ld.so-madvise.diff (text/plain), 2.40 KB, created by
Gleb Stiblo
on 2008-01-31 16:25:15 MSK
(
hide
)
Description:
Сам патч
Filename:
MIME Type:
Creator:
Gleb Stiblo
Created:
2008-01-31 16:25:15 MSK
Size:
2.40 KB
patch
obsolete
>diff -Naur glibc-2.5.1-alt2.orig/elf/dl-load.c glibc-2.5.1-alt2/elf/dl-load.c >--- glibc-2.5.1-alt2.orig/elf/dl-load.c 2008-01-17 16:37:23 +0200 >+++ glibc-2.5.1-alt2/elf/dl-load.c 2008-01-17 16:51:42 +0200 >@@ -1213,6 +1213,11 @@ > goto call_lose_errno; > } > >+ if (GLRO(dl_madvise)) { >+ //fadvising >+ posix_fadvise (fd, c->mapoff, maplength, POSIX_FADV_WILLNEED); >+ } >+ > l->l_map_end = l->l_map_start + maplength; > l->l_addr = l->l_map_start - c->mapstart; > >diff -Naur glibc-2.5.1-alt2.orig/elf/dl-support.c glibc-2.5.1-alt2/elf/dl-support.c >--- glibc-2.5.1-alt2.orig/elf/dl-support.c 2008-01-17 16:37:27 +0200 >+++ glibc-2.5.1-alt2/elf/dl-support.c 2008-01-17 16:44:37 +0200 >@@ -42,6 +42,7 @@ > > int _dl_debug_mask; > int _dl_lazy; >+int _dl_madvise; > ElfW(Addr) _dl_use_load_bias = -2; > int _dl_dynamic_weak; > >@@ -251,6 +252,8 @@ > > _dl_lazy = *(__secure_getenv ("LD_BIND_NOW") ?: "") == '\0'; > >+ _dl_madvise = *(__secure_getenv ("LD_NOMADVISE") ?: "") == '\0'; >+ > _dl_bind_not = *(__secure_getenv ("LD_BIND_NOT") ?: "") != '\0'; > > _dl_dynamic_weak = *(__secure_getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0'; >diff -Naur glibc-2.5.1-alt2.orig/elf/rtld.c glibc-2.5.1-alt2/elf/rtld.c >--- glibc-2.5.1-alt2.orig/elf/rtld.c 2008-01-17 16:37:27 +0200 >+++ glibc-2.5.1-alt2/elf/rtld.c 2008-01-17 16:43:49 +0200 >@@ -152,6 +152,7 @@ > ._dl_lazy = 1, > ._dl_fpu_control = _FPU_DEFAULT, > ._dl_pointer_guard = 1, >+ ._dl_madvise = 1, > > /* Function pointers. */ > ._dl_debug_printf = _dl_debug_printf, >@@ -2574,6 +2575,14 @@ > break; > > case 9: >+ /* Test whether we should not advise the kernel >+ about memory usage. */ >+ if (memcmp (envline, "NOMADVISE", 9) == 0) >+ { >+ GLRO(dl_madvise) = envline[10] == '\0'; >+ break; >+ } >+ > /* Test whether we want to see the content of the auxiliary > array passed up from the kernel. */ > if (memcmp (envline, "SHOW_AUXV", 9) == 0) >diff -Naur glibc-2.5.1-alt2.orig/sysdeps/generic/ldsodefs.h glibc-2.5.1-alt2/sysdeps/generic/ldsodefs.h >--- glibc-2.5.1-alt2.orig/sysdeps/generic/ldsodefs.h 2008-01-17 16:37:26 +0200 >+++ glibc-2.5.1-alt2/sysdeps/generic/ldsodefs.h 2008-01-17 16:43:49 +0200 >@@ -573,6 +573,9 @@ > /* Do we do lazy relocations? */ > EXTERN int _dl_lazy; > >+ /* Should we advise kernel about memory usage? */ >+ EXTERN int _dl_madvise; >+ > /* Nonzero if runtime lookups should not update the .got/.plt. */ > EXTERN int _dl_bind_not; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14264
: 2402