[PATCH] Enable VDSO for static linking on s390

Rafael Avila de Espindola rafael@espindo.la
Thu Jan 31 18:12:00 GMT 2019


"Stefan Liebler" <stli@linux.ibm.com> writes:

> Hi Rafael,
>
> sorry for the delay. I'm just returned from vacation.
>
> Starting with your previous message, I saw the patch.
> But if I look at "Re: [PATCH] Enable VDSO for static linking on s390"
> (https://www.sourceware.org/ml/libc-alpha/2018-12/msg00757.html) I can't
> see it.
>
> Anyway on s390 the vdso is currently only mapped for dynamically linked
> elf binaries! See <kernel-src>/arch/s390/kernel/vdso.c:
> /*
>   * This is called from binfmt_elf, we create the special vma for the
>   * vDSO and insert it into the mm struct tree
>   */
> int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
> {
> 	struct mm_struct *mm = current->mm;
> 	struct vm_area_struct *vma;
> 	unsigned long vdso_pages;
> 	unsigned long vdso_base;
> 	int rc;
>
> 	if (!vdso_enabled)
> 		return 0;
> 	/*
> 	 * Only map the vdso for dynamically linked elf binaries.
> 	 */
> 	if (!uses_interp)
> 		return 0;
> ...
>
> What is your motivation to enable vdso for static binaries?
> Do you have a special workload in mind?

Static linking can be convenient, but if a program uses clock_gettime a
lot it is also a performance regression.

I don't have an immediate use case in mind. I am just going one
architecture at a time in the hope of simplifying the #ifdefs once all
of them support VDSO on statically linked binaries (in glibc at least).

Cheers,
Rafael



More information about the Libc-alpha mailing list