From: Anton Ivanov <anton.ivanov@kot-begemot.co.uk>
To: Lorenzo Colitti <lorenzo@google.com>,
Richard Weinberger <richard@nod.at>
Cc: Thomas Meyer <thomas@m3y3r.de>,
"user-mode-linux-devel@lists.sourceforge.net"
<user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers
Date: Wed, 18 Nov 2015 07:00:10 +0000 [thread overview]
Message-ID: <564C21FA.1010808@kot-begemot.co.uk> (raw)
In-Reply-To: <CAKD1Yr29+9ZiG+ovhmpQE_Rm7Cp7u0sDDsN7fF6Co+y40cF3Gw@mail.gmail.com>
On 18/11/15 01:20, Lorenzo Colitti wrote:
> On Sat, Nov 7, 2015 at 6:56 AM, Richard Weinberger <richard@nod.at> wrote:
>> Am 02.11.2015 um 17:16 schrieb Anton Ivanov:
>>> Background: UML is using an obsolete itimer call for
>>> all timers and "polls" for kernel space timer firing
>>> in its userspace portion resulting in a long list
>>> of bugs and incorrect behaviour(s). It also uses
>>> ITIMER_VIRTUAL for its timer which results in the
>>> timer being dependent on it running and the cpu
>>> load.
>>>
>>> This patch fixes this by moving to posix high resolution
>>> timers firing off CLOCK_MONOTONIC and relaying the timer
>>> correctly to the UML userspace.
>>>
>>> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
>>> Signed-off-by: Anton Ivanov <aivanov@brocade.com>
>> Applied!
> Looks like this broke ARCH=um SUBARCH=x86-64 builds on (at least)
> David Miller's net-next tree. On ubuntu 14.04, gcc (Ubuntu
> 4.8.4-2ubuntu1~14.04) 4.8.4, I get:
>
> arch/um/os-Linux/built-in.o: In function `os_timer_create':
> /android/kernel/android/arch/um/os-Linux/time.c:51: undefined
> reference to `timer_create'
> arch/um/os-Linux/built-in.o: In function `os_timer_set_interval':
> /android/kernel/android/arch/um/os-Linux/time.c:84: undefined
> reference to `timer_settime'
> arch/um/os-Linux/built-in.o: In function `os_timer_remain':
> /android/kernel/android/arch/um/os-Linux/time.c:109: undefined
> reference to `timer_gettime'
> arch/um/os-Linux/built-in.o: In function `os_timer_one_shot':
> /android/kernel/android/arch/um/os-Linux/time.c:132: undefined
> reference to `timer_settime'
> arch/um/os-Linux/built-in.o: In function `os_timer_disable':
> /android/kernel/android/arch/um/os-Linux/time.c:145: undefined
> reference to `timer_settime'
> collect2: error: ld returned 1 exit status
>
> The command being run is this:
>
> + gcc -Wl,-rpath,/lib64 -m64 -Wl,-rpath,/lib -Wl,--wrap,malloc
> -Wl,--wrap,free -Wl,--wrap,calloc -Wl,-m -Wl,elf_x86_64 -lrt -o
> .tmp_vmlinux1 -Wl,-T,./arch/um/kernel/vmlinux.lds init/built-in.o
> -Wl,--start-group usr/built-in.o arch/um/kernel/built-in.o
> arch/um/drivers/built-in.o arch/um/os-Linux/built-in.o
> arch/x86/crypto/built-in.o arch/x86/um/built-in.o kernel/built-in.o
> certs/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o
> security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a
> lib/built-in.o drivers/built-in.o sound/built-in.o firmware/built-in.o
> net/built-in.o virt/built-in.o -Wl,--end-group -lutil
>
> The following patch results in a working kernel, but I have no idea if
> it's correct. Thoughts?
It is.
You need -lrt to link in HR timers. However, the original patch should
add that to the library list. I need to understand why it does not in
the dm tree.
A.
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 25ed409..e3abe6f 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -131,7 +131,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
> # The wrappers will select whether using "malloc" or the kernel allocator.
> LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
>
> -LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) -lrt
> +LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
>
> # Used by link-vmlinux.sh which has special support for um link
> export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index 1a10d8a..dacf71a 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -62,7 +62,7 @@ vmlinux_link()
> -Wl,--start-group \
> ${KBUILD_VMLINUX_MAIN} \
> -Wl,--end-group \
> - -lutil ${1}
> + -lutil -lrt ${1}
> rm -f linux
> fi
> }
------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2015-11-18 7:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 16:16 [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers Anton Ivanov
2015-11-02 21:50 ` Richard Weinberger
2015-11-02 22:13 ` Anton Ivanov
2015-11-03 7:11 ` Anton Ivanov
2015-11-03 7:58 ` Thomas Meyer
2015-11-06 21:56 ` Richard Weinberger
2015-11-07 10:29 ` Anton Ivanov
2015-11-07 10:32 ` Richard Weinberger
2015-11-18 1:20 ` Lorenzo Colitti
2015-11-18 7:00 ` Anton Ivanov [this message]
2015-11-18 7:10 ` Lorenzo Colitti
2015-11-18 8:06 ` Richard Weinberger
2015-11-18 13:32 ` Lorenzo Colitti
2015-11-18 13:40 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564C21FA.1010808@kot-begemot.co.uk \
--to=anton.ivanov@kot-begemot.co.uk \
--cc=lorenzo@google.com \
--cc=richard@nod.at \
--cc=thomas@m3y3r.de \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).