[uml-devel] PATCH v4

2017-10-04 Thread anton . ivanov
This update cleans up the code and simplifies the xmit routines to share some of the code. It also brings tap up to date to do scatter gather and TSO on transmit. The result is ... drum roll... 4.5Gbit+ on iperf on my laptop. As a reference QEMU+kvm with all bells and whistles does under 1GBit and

[uml-devel] [PATCH v4] UBD Improvements

2016-11-09 Thread anton . ivanov
From: Anton Ivanov UBD at present is extremely slow because it handles only one request at a time in the IO thread and IRQ handler. The single request at a time is replaced by handling multiple requests as well as necessary workarounds for short reads/writes. Resulting performance improvement i

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-18 Thread Richard Weinberger
Hi! Am 18.11.2015 um 14:32 schrieb Lorenzo Colitti: > On Wed, Nov 18, 2015 at 5:06 PM, Richard Weinberger wrote: >> >>> That command line doesn't work, but if you remove the -lrt and put it >>> at the end of the line, it starts working. Is the order significant? >>> Or is it a bug in GCC's comman

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-18 Thread Lorenzo Colitti
On Wed, Nov 18, 2015 at 5:06 PM, Richard Weinberger wrote: > > > That command line doesn't work, but if you remove the -lrt and put it > > at the end of the line, it starts working. Is the order significant? > > Or is it a bug in GCC's command line parsing? > > The order matters. > -lrt has to be

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-18 Thread Richard Weinberger
Am 18.11.2015 um 08:10 schrieb Lorenzo Colitti: > On Wed, Nov 18, 2015 at 4:00 PM, Anton Ivanov > wrote: >> 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. > > I noticed th

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-17 Thread Lorenzo Colitti
On Wed, Nov 18, 2015 at 4:00 PM, Anton Ivanov wrote: > 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. I noticed that command already does contain "-lrt", just in a different p

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-17 Thread Anton Ivanov
On 18/11/15 01:20, Lorenzo Colitti wrote: > On Sat, Nov 7, 2015 at 6:56 AM, Richard Weinberger 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 res

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-17 Thread Lorenzo Colitti
On Sat, Nov 7, 2015 at 6:56 AM, Richard Weinberger 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 incorre

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-07 Thread Richard Weinberger
Hi! Am 07.11.2015 um 11:29 schrieb Anton Ivanov: > Cool, > > Is there a tree I can pull so I can have the next one (the epoll based IRQ > controller) incremental? Sure, it is in uml's next: https://git.kernel.org/cgit/linux/kernel/git/rw/uml.git/log/?h=linux-next Thanks, //richard ---

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-07 Thread Anton Ivanov
Cool, Is there a tree I can pull so I can have the next one (the epoll based IRQ controller) incremental? A. On 06/11/15 21:56, Richard Weinberger 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 s

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-06 Thread Richard Weinberger
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 resu

Re: [uml-devel] [PATCH v4] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held

2015-11-06 Thread Richard Weinberger
Am 29.10.2015 um 16:30 schrieb Saurabh Sengar: > since GFP_KERNEL with GFP_ATOMIC while spinlock is held, > as code while holding a spinlock should be atomic. > GFP_KERNEL may sleep and can cause deadlock, > where as GFP_ATOMIC may fail but certainly avoids deadlockdex > f70dd54..d898f6c 100644 >

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-03 Thread Thomas Meyer
Am 03.11.2015 8:11 vorm. schrieb Anton Ivanov : > > On 02/11/15 22:13, Anton Ivanov wrote: > > On 02/11/15 21:50, Richard Weinberger wrote: > >> Am 02.11.2015 um 17:16 schrieb Anton Ivanov: > >>> -void idle_sleep(unsigned long long nsecs) > >>> +/** > >>> + * os_idle_sleep() - sleep for a giv

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-02 Thread Anton Ivanov
On 02/11/15 22:13, Anton Ivanov wrote: > On 02/11/15 21:50, Richard Weinberger wrote: >> Am 02.11.2015 um 17:16 schrieb Anton Ivanov: >>> -void idle_sleep(unsigned long long nsecs) >>> +/** >>> + * os_idle_sleep() - sleep for a given time of nsecs >>> + * @nsecs: nanoseconds to sleep >>> + */ >>> +

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-02 Thread Anton Ivanov
On 02/11/15 21:50, Richard Weinberger wrote: > Am 02.11.2015 um 17:16 schrieb Anton Ivanov: >> -void idle_sleep(unsigned long long nsecs) >> +/** >> + * os_idle_sleep() - sleep for a given time of nsecs >> + * @nsecs: nanoseconds to sleep >> + */ >> +void os_idle_sleep(unsigned long long nsecs) >>

Re: [uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-02 Thread Richard Weinberger
Am 02.11.2015 um 17:16 schrieb Anton Ivanov: > -void idle_sleep(unsigned long long nsecs) > +/** > + * os_idle_sleep() - sleep for a given time of nsecs > + * @nsecs: nanoseconds to sleep > + */ > +void os_idle_sleep(unsigned long long nsecs) > { > struct timespec ts; > > - /* > -

[uml-devel] [PATCH v4] um: Switch clocksource to hrtimers

2015-11-02 Thread 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

[uml-devel] [PATCH v4 1/2] mm: Introducing arch_remap hook

2015-03-28 Thread Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call. This patch is introducing a new arch_remap mm hook which is placed in the path of mremap, and is called before the old area is unmapped (and the arch_unmap hook is called). The architectures w

[uml-devel] [PATCH v4 0/2] Tracking user space vDSO remaping

2015-03-28 Thread Laurent Dufour
CRIU is recreating the process memory layout by remapping the checkpointee memory area on top of the current process (criu). This includes remapping the vDSO to the place it has at checkpoint time. However some architectures like powerpc are keeping a reference to the vDSO base address to build th

Re: [uml-devel] [PATCH v4 2/2] powerpc/mm: Tracking vDSO remap

2015-03-28 Thread Laurent Dufour
On 26/03/2015 19:55, Ingo Molnar wrote: > > * Laurent Dufour wrote: > >> +{ >> +unsigned long vdso_end, vdso_start; >> + >> +if (!mm->context.vdso_base) >> +return; >> +vdso_start = mm->context.vdso_base; >> + >> +#ifdef CONFIG_PPC64 >> +/* Calling is_32bit_task() imp

Re: [uml-devel] [PATCH v4 2/2] powerpc/mm: Tracking vDSO remap

2015-03-28 Thread Ingo Molnar
* Laurent Dufour wrote: > +{ > + unsigned long vdso_end, vdso_start; > + > + if (!mm->context.vdso_base) > + return; > + vdso_start = mm->context.vdso_base; > + > +#ifdef CONFIG_PPC64 > + /* Calling is_32bit_task() implies that we are dealing with the > + * curre

[uml-devel] [PATCH v4 2/2] powerpc/mm: Tracking vDSO remap

2015-03-28 Thread Laurent Dufour
Some processes (CRIU) are moving the vDSO area using the mremap system call. As a consequence the kernel reference to the vDSO base address is no more valid and the signal return frame built once the vDSO has been moved is not pointing to the new sigreturn address. This patch handles vDSO remappin

[uml-devel] [PATCH v4 2/2] um: add a kmsg_dumper

2015-03-28 Thread Thomas Meyer
Add a kmsg_dumper, that dumps the kmsg buffer to stdout, when no console is available. This an enables the printing of early panic() calls triggered in uml_postsetup(). When a panic() call happens so early in the UML kernel no earlyprintk/console is available yet, but with a kmsg_dumper in place t

[uml-devel] [PATCH v4 1/2] um: Move uml_postsetup in the init_thread stack

2015-03-28 Thread Thomas Meyer
atomic_notifier_chain_register() and uml_postsetup() do call kernel code that rely on the "current" kernel macro and a valid task_struct resp. thread_info struct. Give those functions a valid stack by moving uml_postsetup() in the init_thread stack. This moves enables a panic() call in this early

[uml-devel] [PATCH v4 11/11] Replace fsync() with sync_file_range()

2014-09-22 Thread anton . ivanov
From: Anton Ivanov If the ubd is asynchronous the amount of time uml will spend fsync-ing on FLUSH is unpredictable. There are bits in the upper fs layers that really dislike this. Replacing fsync() with an async flush request via sync_file_range mitigates this (somewhat), improves performance si

[uml-devel] [PATCH v4 10/11] High Resolution Timer subsystem for UML

2014-09-22 Thread anton . ivanov
From: Anton Ivanov This patch adds an extra timer source which has correct timing and uses an up-to-date OS API and. Results - correct kernel behaviour on timer related tasks. 1. Improvement in network performance (TCP state machines are now fed correct time). 2. Correct QoS and traffic

[uml-devel] [PATCH v4 05/11] GRE transport for UML

2014-09-22 Thread anton . ivanov
From: Anton Ivanov This transport allows a UML to connect to another UML local or remote, the Linux host or any other network device running the industry standard Ethernet over GRE protocol. The transport supports all features of RFC 2784. The transport supports a common set of features with the

[uml-devel] [PATCH v4 03/11] High performance networking subsystem

2014-09-22 Thread anton . ivanov
From: Anton Ivanov Support for multi-packet vector IO - multiple packets read in one syscall and (optionally) written in one syscall. Support for (optional) queueing on EAGAIN/ENOBUFS - applies only to socket transports. Sorry TAP, -EYOULOSE - it will remain slower than any so

[uml-devel] [PATCH v4 01/11] Epoll based interrupt controller

2014-09-22 Thread anton . ivanov
From: Anton Ivanov 1. Minimum kernel 2.5.44 2. No "walk the list" lookups for received IRQs - immediate identification of the correct handler to invoke 3. Full set of IRQ semantics - edge, level, read, write 3.1. Write is now a *REAL* write - so if you (ab)use the write to signify NONE (a

[uml-devel] [PATCH v4 02/11] Remove unnecessary 'reactivate' statements

2014-09-22 Thread anton . ivanov
From: Anton Ivanov The epoll based controller has real (not emulated) edge and level semantics and the edge/level is handled by epoll. There is no toggling of the poll set any more, thus it is removed throughout Signed-off-by: Anton Ivanov --- arch/um/drivers/chan_kern.c |2 -- arch/um

[uml-devel] [PATCH v4 07/11] Performance and NUMA improvements for ubd

2014-09-22 Thread anton . ivanov
From: Anton Ivanov The use of the seek()/read() and seek()/write() is a terminal disease on NUMA. Intense use of this on shared files (f.e. the master for a COW image) can cause anything up to and including killing CPUs on unhandled NMIs. This patch deals with this UML major issue (and one of UM

[uml-devel] [PATCH v4 09/11] Better IPC for UBD

2014-09-22 Thread anton . ivanov
From: Anton Ivanov socketpair() is a better IPC choice for lots of small requests as it allows deeper (and configurable) queues than pipe() As a result UBD will process nearly all of the requests submitted to it instead of bouncing a significant percentage under load Signed-off-by: Anton Ivanov

[uml-devel] [PATCH v4 08/11] Minor performance optimization for ubd

2014-09-22 Thread anton . ivanov
From: Anton Ivanov Obvious performance optimization - it is not necessary to read the requests one at a time in the IRQ handler Signed-off-by: Anton Ivanov --- arch/um/drivers/ubd_kern.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/arch/u

[uml-devel] [PATCH v4 06/11] RAW Ethernet transport for UML

2014-09-22 Thread anton . ivanov
From: Anton Ivanov This is an alternative to the well known pcap transport. In the absense of special hardware support pcap is slow, guaranteed to be slow and with significant penalties on NUMA/SMP systems due to the timestamping of every packet. This transport does not incur any of these times

Re: [uml-devel] [PATCH v4] arm64, ia64, ppc, s390, sh, tile, um, x86, mm: Remove default gate area

2014-08-11 Thread Michael Ellerman
On Thu, 2014-07-24 at 13:56 -0700, Andy Lutomirski wrote: > The core mm code will provide a default gate area based on > FIXADDR_USER_START and FIXADDR_USER_END if > !defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR). > > This default is only useful for ia64. arm64, ppc, s390, sh, tile,

[uml-devel] [PATCH v4] arm64, ia64, ppc, s390, sh, tile, um, x86, mm: Remove default gate area

2014-07-24 Thread Andy Lutomirski
The core mm code will provide a default gate area based on FIXADDR_USER_START and FIXADDR_USER_END if !defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR). This default is only useful for ia64. arm64, ppc, s390, sh, tile, 64-bit UML, and x86_32 have their own code just to disable it. arm,

[uml-devel] [PATCH v4, part3 07/41] UML: normalize global variables exported by vmlinux.lds

2013-04-06 Thread Jiang Liu
Normalize global variables exported by vmlinux.lds to conform usage guidelines from include/asm-generic/sections.h. 1) Use _text to mark the start of the kernel image including the head text, and _stext to mark the start of the .text section. 2) Export mandatory global variables __bss_stop. 3) Adj

[uml-devel] [PATCH v4, part3 37/41] mm/um: prepare for removing num_physpages and simplify mem_init()

2013-04-06 Thread Jiang Liu
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu Cc: Jeff Dike Cc: Richard Weinberger Cc: user-mode-linux-devel@lists.sourceforge.net Cc: linux-ker...@vger.kernel.org --- arch/um/kernel/mem.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[uml-devel] [PATCH v4 19/31] fs: add read_iter and write_iter to several file systems

2012-11-21 Thread Dave Kleikamp
These are the simple ones. File systems that use generic_file_aio_read() and generic_file_aio_write() can trivially support generic_file_read_iter() and generic_file_write_iter(). This patch adds those file_operations for 9p, adfs, affs, bfs, exofs, ext2, ext3, fat, hfs, hfsplus, hostfs, hpfs, jf

[uml-devel] [PATCH v4 04/12] vsprintf: use TOLOWER whenever possible

2009-11-08 Thread André Goddard Rosa
It decreases code size as well: textdata bss dec hex filename 15767 0 8 157753d9f lib/vsprintf.o-before 15735 0 8 157433d7f lib/vsprintf.o-TOLOWER Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 15

[uml-devel] [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function

2009-11-08 Thread André Goddard Rosa
Makes use of skip_spaces() defined in lib/string.c for removing leading spaces from strings all over the tree. Also, while at it, if we see (*str && isspace(*str)), we can be sure to remove the first condition (*str) as the second one (isspace(*str)) also evaluates to 0 whenever *str == 0, making

[uml-devel] [PATCH v4 03/12] vsprintf: give it some care to please checkpatch.pl

2009-11-08 Thread André Goddard Rosa
Most relevant complaints were addressed. Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 186 ++-- 1 files changed, 99 insertions(+), 87 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 403

[uml-devel] [PATCH v4 00/12] introduce skip_spaces(), reducing code size plus some clean-ups

2009-11-08 Thread André Goddard Rosa
This patch reduces lib.a code size by 173 bytes on my Core 2 with gcc 4.4.1 even considering that it exports a newly defined function skip_spaces() to drivers: textdata bss dec hex filename 64867 840 592 66299 102fb (TOTALS-lib.a-before)

[uml-devel] [PATCH v4 01/12] vsprintf: factorize "(null)" string

2009-11-08 Thread André Goddard Rosa
Change "" to "(null)" and make it a static const char[] hoping that the compiler will make null_str a label to a read-only area containing it. See: http://people.redhat.com/drepper/dsohowto.pdf part 2.4.2 http://udrepper.livejournal.com/13851.html http://udrepper.livejournal.com/15119.html Signed

[uml-devel] [PATCH v4 09/12] ctype: constify read-only _ctype string

2009-11-08 Thread André Goddard Rosa
While at it, use tabs to indent the comments. Signed-off-by: André Goddard Rosa --- include/linux/ctype.h |2 +- lib/ctype.c | 50 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/linux/ctype.h b/include/lin

[uml-devel] [PATCH v4 08/12] vsprintf: reuse almost identical simple_strtoulX() functions

2009-11-08 Thread André Goddard Rosa
The difference between simple_strtoul() and simple_strtoull() is just the size of the variable used to keep track of the sum of characters converted to numbers: unsigned long simple_strtoul() {...} unsigned long long simple_strtoull(){...} Both are same size (8 bytes) on my Core 2/gcc 4.4.1. Over

Re: [uml-devel] [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function

2009-11-08 Thread Julia Lawall
> > Also, while at it, if we see (*str && isspace(*str)), we can be sure to > > remove the first condition (*str) as the second one (isspace(*str)) also > > evaluates to 0 whenever *str == 0, making it redundant. In other words, > > "a char equals zero is never a space". I tried the following sema

Re: [uml-devel] [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function

2009-11-08 Thread Theodore Tso
On Sat, Nov 07, 2009 at 01:16:20PM -0200, André Goddard Rosa wrote: > Makes use of skip_spaces() defined in lib/string.c for removing leading > spaces from strings all over the tree. > > Also, while at it, if we see (*str && isspace(*str)), we can be sure to > remove the first condition (*str) as

[uml-devel] [PATCH v4 07/12] vsprintf: factor out skip_space code in a separate function

2009-11-08 Thread André Goddard Rosa
It decreases code size: textdata bss dec hex filename 15719 0 8 157273d6f lib/vsprintf.o-before 15543 0 8 155513cbf lib/vsprintf.o-after Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 19 +

[uml-devel] [PATCH v4 06/12] vsprintf: move local vars to block local vars and remove unneeded ones

2009-11-08 Thread André Goddard Rosa
Cleanup by moving variables closer to the scope where they're used in fact. Also, remove unneeded ones. Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 64 --- 1 files changed, 28 insertions(+), 36 deleti

[uml-devel] [PATCH v4 02/12] vsprintf: pre-calculate final string length for later use

2009-11-08 Thread André Goddard Rosa
Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 002f462..403e835 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1445,13 +1445,15 @@ do

[uml-devel] [PATCH v4 10/12] string: factorize skip_spaces and export it to be generally available

2009-11-08 Thread André Goddard Rosa
On the following sentence: while (*s && isspace(*s)) s++; If *s == 0, isspace() evaluates to ((_ctype[*s] & 0x20) != 0), which evaluates to ((0x08 & 0x20) != 0) which equals to 0 as well. If *s == 1, we depend on isspace() result anyway. In other words, "a char equals zero is never a

[uml-devel] [PATCH v4 05/12] vsprintf: reduce code size by avoiding extra check

2009-11-08 Thread André Goddard Rosa
No functional change, just refactor the code so that it avoid checking "if (hi)" two times in a sequence, taking advantage of previous check made. It also reduces code size: textdata bss dec hex filename 15735 0 8 157433d7f lib/vsprintf.o-before 15719

Re: [uml-devel] [PATCH v4 10/12] string: factorize skip_spaces and export it to be generally available

2009-11-08 Thread Alan Cox
On Sat, 7 Nov 2009 13:16:18 -0200 André Goddard Rosa wrote: > On the following sentence: > while (*s && isspace(*s)) > s++; Looks fine but for one thing: it's actually shorter inline than moved into /lib so at the very least it should be a header inline not a function call. Second

[uml-devel] [PATCH v4 11/12] string: on strstrip(), first remove leading spaces before running over str

2009-11-08 Thread André Goddard Rosa
... so that strlen() iterates over a smaller string comprising of the remaining characters only. Signed-off-by: André Goddard Rosa --- lib/string.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/string.c b/lib/string.c index d9a51d5..cf86eab 100644 --- a/lib/stri