Re: [PATCH] dynamic_debug: change __dynamic__dbg return types to void

2014-10-03 Thread Jason Baron
On 09/24/2014 02:17 PM, Joe Perches wrote: > The return value is not used by callers of these functions > so change the functions to return void. > Acked-by: Jason Baron Greg - can you pick this up? Thanks, -Jason -- To unsubscribe from this list: send the line "unsubscribe li

Re: [PATCH V4] kernel, add bug_on_warn

2014-10-27 Thread Jason Baron
Hi Prarit, On 10/24/2014 08:53 AM, Prarit Bhargava wrote: > There have been several times where I have had to rebuild a kernel to > cause a panic when hitting a WARN() in the code in order to get a crash > dump from a system. Sometimes this is easy to do, other times (such as > in the case of a r

Re: Kernel broken on processors without performance counters

2015-07-22 Thread Jason Baron
On 07/22/2015 12:24 AM, Borislav Petkov wrote: > On Tue, Jul 21, 2015 at 02:50:25PM -0400, Jason Baron wrote: >> hmmm...so this is a case where need to the default the branch >> to the out-of-line branch at boot. That is, we can't just enable >> the out-of-line branch at

Re: Kernel broken on processors without performance counters

2015-07-23 Thread Jason Baron
On 07/23/2015 06:42 AM, Peter Zijlstra wrote: > On Wed, Jul 22, 2015 at 01:06:44PM -0400, Jason Baron wrote: >> Ok, >> >> So we could add all 4 possible initial states, where the >> branches would be: >> >> static_likely_init_true_branch(

Re: Kernel broken on processors without performance counters

2015-07-23 Thread Jason Baron
On 07/23/2015 01:08 PM, Peter Zijlstra wrote: > On Thu, Jul 23, 2015 at 11:34:50AM -0400, Steven Rostedt wrote: >> On Thu, 23 Jul 2015 12:42:15 +0200 >> Peter Zijlstra wrote: >> >>> static __always_inline bool arch_static_branch_jump(struct static_key *key, >>> bool inv) >>> { >>> if (!inv) {

Re: Kernel broken on processors without performance counters

2015-07-23 Thread Jason Baron
On 07/23/2015 10:49 AM, Peter Zijlstra wrote: > On Thu, Jul 23, 2015 at 04:33:08PM +0200, Peter Zijlstra wrote: >> Lemme finish this and I'll post it. > Compile tested on x86_64 only.. > > Please have a look, I think you said I got some of the logic wrong, I've > not double checked that. > > I'll g

Re: Kernel broken on processors without performance counters

2015-07-24 Thread Jason Baron
On 07/24/2015 08:36 AM, Peter Zijlstra wrote: > On Fri, Jul 24, 2015 at 12:56:02PM +0200, Peter Zijlstra wrote: >> On Thu, Jul 23, 2015 at 03:14:13PM -0400, Jason Baron wrote: >>>> +static enum jump_label_type jump_label_type(struct jump_entry *entry) >>>>

Re: epoll and multiple processes - eliminate unneeded process wake-ups

2015-08-04 Thread Jason Baron
2. If none of processes are in wait state, then send the event to >> all epoll sets (as it is currently). Then the first free process >> will grab the event. > > Jason Baron was working on this (search LKML archives for > EPOLLEXCLUSIVE, EPOLLROUNDROBIN, EPOLL_ROTATE) > >

Re: epoll and multiple processes - eliminate unneeded process wake-ups

2015-08-05 Thread Jason Baron
On 08/05/2015 07:06 AM, Madars Vitolins wrote: > Jason Baron @ 2015-08-04 18:02 rakstīja: >> On 08/03/2015 07:48 PM, Eric Wong wrote: >>> Madars Vitolins wrote: >>>> Hi Folks, >>>> >>>> I am developing kind of open systems application, which

Re: Kernel broken on processors without performance counters

2015-07-08 Thread Jason Baron
On 07/08/2015 01:37 PM, Andy Lutomirski wrote: > On Wed, Jul 8, 2015 at 9:07 AM, Peter Zijlstra wrote: >> On Wed, Jul 08, 2015 at 11:17:38AM -0400, Mikulas Patocka wrote: >>> Hi >>> >>> I found out that the patch a66734297f78707ce39d756b656bfae861d53f62 breaks >>> the kernel on processors without

Re: Kernel broken on processors without performance counters

2015-07-09 Thread Jason Baron
On 07/09/2015 01:11 PM, Peter Zijlstra wrote: > On Wed, Jul 08, 2015 at 04:04:32PM -0400, Jason Baron wrote: >> So the 'static_key_false' is really branch is initially false. We had >> a naming discussion before, but if ppl think its confusing, >&

Re: [PATCH -v2 7/8] jump_label: Add selftest

2015-07-28 Thread Jason Baron
644 index 000..5a5eb86 --- /dev/null +++ b/lib/test_jump_label.c @@ -0,0 +1,225 @@ +/* + * Kernel module for testing jump labels. + * + * Copyright 2015 Akamai Technologies Inc. All Rights Reserved + * + * Authors: + * Jason Baron + * + * This software is licensed under the ter

[PATCH v2] ie31200_edac: add Skylake support

2016-05-06 Thread Jason Baron
resest for us. Tested on Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz. Signed-off-by: Jason Baron Acked-by: Tony Luck --- drivers/edac/ie31200_edac.c | 121 1 file changed, 90 insertions(+), 31 deletions(-) diff --git a/drivers/edac/ie31200_ed

[PATCH] ie31200_edac: add skylake support

2016-05-04 Thread Jason Baron
I've verified that the 'ce_count' is correctly incrementing with bad dimms. Signed-off-by: Jason Baron --- drivers/edac/ie31200_edac.c | 110 1 file changed, 81 insertions(+), 29 deletions(-) diff --git a/drivers/edac/ie31200_edac.c

Re: [PATCH] ie31200_edac: add skylake support

2016-05-04 Thread Jason Baron
On 05/04/2016 01:44 PM, Luck, Tony wrote: I've verified that the 'ce_count' is correctly incrementing with bad dimms. Did you re-test on at least one of the previous 3 generations of CPUs supported by this driver? All would be nice, but the bulk of the opportunities for cut&paste errors seem

[PATCH v2 1/4] jump_label: remove bug.h, atomic.h dependencies for HAVE_JUMP_LABEL

2016-05-20 Thread Jason Baron
jump_label.h 'includable' from most places. Signed-off-by: Jason Baron --- include/linux/jump_label.h | 50 +++--- kernel/jump_label.c| 48 2 files changed, 78 insertions(+), 20 deletions(-) di

[PATCH v2 0/4] convert dynamic_debug to use jump labels

2016-05-20 Thread Jason Baron
dable from mostly anywhere. There were a couple of arch specific changes for powerpc (patch #2) and s390 (patch #3) that fell out as well...hopefully this version compiles everywhere. Thanks, -Jason Jason Baron (4): jump_label: remove bug.h, atomic.h dependencies for HAVE_JUMP_LABEL powerpc

[PATCH v2 3/4] s390: add explicit for jump label

2016-05-20 Thread Jason Baron
Ensure that we always have __stringify(). Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux-s...@vger.kernel.org Signed-off-by: Jason Baron --- arch/s390/include/asm/jump_label.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm

[PATCH v2 4/4] dynamic_debug: add jump label support

2016-05-20 Thread Jason Baron
the direction of the branches, and hence usually not in cache. textdata bss dec hex filename 8194852 4879776 925696 14000324 d5a0c4 vmlinux.pre 8187337 4960224 925696 14073257 d6bda9 vmlinux.post Signed-off-by: Jason Baron --- include/linux/dynamic_debug.h

[PATCH v2 2/4] powerpc: add explicit #include for jump label

2016-05-20 Thread Jason Baron
The stringify_in_c() macro may not be included. Make the dependency explicit. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Jason Baron --- arch/powerpc/include/asm/jump_label.h | 1 + 1 file changed, 1 insertion(+) diff

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue

2015-11-11 Thread Jason Baron
Hi Rainer, > + > +/* Needs sk unix state lock. After recv_ready indicated not ready, > + * establish peer_wait connection if still needed. > + */ > +static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other) > +{ > + int connected; > + > + connected = unix_dgram_peer_wake_conn

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue

2015-11-13 Thread Jason Baron
On 11/13/2015 01:51 PM, Rainer Weikusat wrote: [...] > > - if (unix_peer(other) != sk && unix_recvq_full(other)) { > - if (!timeo) { > - err = -EAGAIN; > - goto out_unlock; > - } > + if (unix_peer(sk) == other && !unix_dg

Re: [PATCH] printk: fix pr_debug and pr_devel to elide function calls

2015-12-04 Thread Jason Baron
On 12/03/2015 05:45 PM, Aaron Conole wrote: > Currently, pr_debug and pr_devel will not elide function call arguments > appearing in calls to no_printk for these macros. This is because all > side effects must be honored before proceeding to the 0-value assignment > in no_printk. > > The behavior

Re: use-after-free in sctp_do_sm

2015-12-04 Thread Jason Baron
On 12/04/2015 11:12 AM, Dmitry Vyukov wrote: > On Thu, Dec 3, 2015 at 9:51 PM, Joe Perches wrote: >> (adding lkml as this is likely better discussed there) >> >> On Thu, 2015-12-03 at 15:42 -0500, Jason Baron wrote: >>> On 12/03/2015 03:24 PM, Joe Perches wrote: &g

Re: use-after-free in sctp_do_sm

2015-12-04 Thread Jason Baron
On 12/04/2015 12:03 PM, Joe Perches wrote: > On Fri, 2015-12-04 at 11:47 -0500, Jason Baron wrote: >> When DYNAMIC_DEBUG is enabled we have this wrapper from >> include/linux/dynamic_debug.h: >> >> if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) >&g

Re: epoll and multiple processes - eliminate unneeded process wake-ups

2015-11-30 Thread Jason Baron
more timely manner if some threads are busy. We probably also don't want to allow the flag for nested ep descriptors. Thanks, -Jason > Or maybe somebody else who is familiar with kernel epoll functionality > can comment this? > > Regarding the flag's bitmask, seems like (1<&

Re: [PATCH 09/13] mm: memcontrol: generalize the socket accounting jump label

2015-11-30 Thread Jason Baron
Hi, On 11/24/2015 04:52 PM, Johannes Weiner wrote: > The unified hierarchy memory controller is going to use this jump > label as well to control the networking callbacks. Move it to the > memory controller code and give it a more generic name. > > Signed-off-by: Johannes Weiner > Acked-by: Mich

Re: [PATCH 09/13] mm: memcontrol: generalize the socket accounting jump label

2015-11-30 Thread Jason Baron
On 11/30/2015 04:50 PM, Johannes Weiner wrote: > On Mon, Nov 30, 2015 at 04:08:18PM -0500, Jason Baron wrote: >> We're trying to move to the updated API, so this should be: >> static_branch_unlikely(&memcg_sockets_enabled_key) >> >> see: include/linux/jump_

Re: epoll and multiple processes - eliminate unneeded process wake-ups

2015-12-01 Thread Jason Baron
Hi Madars, On 11/30/2015 04:28 PM, Madars Vitolins wrote: > Hi Jason, > > I today did search the mail archive and checked your offered patch did on > February, it basically does the some (flag for add_wait_queue_exclusive() + > balance). > > So I plan to run off some tests with your patch, fla

Re: question about cpusets vs sched_setaffinity()

2015-12-14 Thread Jason Baron
On 12/11/2015 06:26 PM, Chris Friesen wrote: > On 12/11/2015 04:15 PM, Jason Baron wrote: >> On 12/10/2015 04:30 PM, Chris Friesen wrote: > >>> If I put a task into a cpuset and then call sched_setaffinity() on it, >>> it will be affined to the intersection of

Re: [PATCH] lib/dynamic_debug.c: use kstrdup_const

2015-09-10 Thread Jason Baron
Looks fine to me. Acked-by: Jason Baron Andrew, want to pick this up? Thanks, -Jason On 09/09/2015 05:40 PM, Rasmus Villemoes wrote: > Using kstrdup_const, thus reusing .rodata when possible, saves around > 2 kB of runtime memory on my laptop/.config combination. > > Signed-of

Re: use-after-free in sock_wake_async

2015-11-24 Thread Jason Baron
On 11/24/2015 10:21 AM, Eric Dumazet wrote: > On Tue, Nov 24, 2015 at 6:18 AM, Dmitry Vyukov wrote: >> Hello, >> >> The following program triggers use-after-free in sock_wake_async: >> >> // autogenerated by syzkaller (http://github.com/google/syzkaller) >> #include >> #include >> #include >>

[PATCH] epoll: add exclusive wakeups flag

2015-12-07 Thread Jason Baron
ne or more epfds will receive an event with epoll_wait(2). The default in this scenario (when EPOLLEXCLUSIVE is not set) is for all epfds to receive an event. EPOLLEXLUSVIE may only be specified with the op EPOLL_CTL_ADD. Jason Baron (1): epoll: add EPOLLEXCLUSIVE flag fs/e

[PATCH] epoll: add EPOLLEXCLUSIVE flag

2015-12-07 Thread Jason Baron
Madars Vitolins Signed-off-by: Jason Baron --- fs/eventpoll.c | 24 +--- include/uapi/linux/eventpoll.h | 3 +++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 1e009ca..ae1dbcf 100644 --- a/fs/eventpoll.c

Re: [PATCH 1/2] dynamic_debug: fix boot parameters parse

2015-10-28 Thread Jason Baron
On 10/27/2015 03:40 AM, Peter Chen wrote: > The parse_args will delete space between boot parameters, so > if we add dyndbg="file drivers/usb/* +p" at bootargs, the parse_args > will split it as three parameters, and only "file" is for dyndbg, > then below error will occur at ddebug, it causes all

Re: [RFC] unix: fix use-after-free in unix_dgram_poll()

2015-10-28 Thread Jason Baron
On 10/28/2015 12:46 PM, Rainer Weikusat wrote: > Rainer Weikusat writes: >> Jason Baron writes: > > [...] > >>> 2) >>> >>> For the case of epoll() in edge triggered mode we need to ensure that >>> when we return -EAGAIN from unix_dgram_se

Re: Kernel broken on processors without performance counters

2015-07-21 Thread Jason Baron
On 07/21/2015 12:12 PM, Peter Zijlstra wrote: > On Tue, Jul 21, 2015 at 08:51:51AM -0700, Andy Lutomirski wrote: >> To clarify my (mis-)understanding: >> >> There are two degrees of freedom in a static_key. They can start out >> true or false, and they can be unlikely or likely. Are those two >

Re: Kernel broken on processors without performance counters

2015-07-21 Thread Jason Baron
On 07/21/2015 02:15 PM, Borislav Petkov wrote: > On Tue, Jul 21, 2015 at 06:12:15PM +0200, Peter Zijlstra wrote: >> Yes, if you start out false, you must be unlikely. If you start out >> true, you must be likely. >> >> We could maybe try and untangle that if there really is a good use case, >> bu

Re: [PATCH] locking/static_keys: avoid nested functions

2016-02-08 Thread Jason Baron
the array. > > Signed-off-by: Arnd Bergmann > --- > lib/test_static_keys.c | 62 > ++ > 1 file changed, 42 insertions(+), 20 deletions(-) > Works for me. Acked-by: Jason Baron Thanks, -Jason

softirq under reporting with CONFIG_NO_HZ_* and under syn flood ?

2015-05-04 Thread Jason Baron
Hi, Creating a synflood via: 'hping3 -V -S -M 0 -p 80 --flood -y ', when I have: CONFIG_NO_HZ_IDLE=y or CONFIG_NO_HZ_FULL=y set, and either: CONFIG_VIRT_CPU_ACCOUNTING_GEN=y or CONFIG_TICK_CPU_ACCOUNTING=y shows almost 0% cpu usage via top (or /proc/stat), whereas if I have turbostat running

[PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-02-24 Thread Jason Baron
ithin the epoll code -Add epoll optimization for overflow list Jason Baron (3): sched/wait: add __wake_up_rotate() epoll: limit wakeups to the overflow list epoll: Add EPOLL_ROTATE mode fs/eventpoll.c | 52 +++--- include/linux/wait.h

[PATCH v3 3/3] epoll: Add EPOLL_ROTATE mode

2015-02-24 Thread Jason Baron
ters. The idea is to use this additional heuristic in order minimize wakeup latencies. Signed-off-by: Jason Baron --- fs/eventpoll.c | 41 +++-- include/uapi/linux/eventpoll.h | 4 2 files changed, 39 insertions(+), 6 deletions(-)

[PATCH v3 2/3] epoll: restrict wakeups to the overflow list

2015-02-24 Thread Jason Baron
a call overheads). However, we wish to add policies that are stateful (for example rotating wakeups among epoll sets), and these unnecessary wakeups cause unwanted transitions. Signed-off-by: Jason Baron --- fs/eventpoll.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git

[PATCH v3 1/3] sched/wait: add __wake_up_rotate()

2015-02-24 Thread Jason Baron
s that it that often results in the same thread woken up again and again. The first intended user of this functionality is epoll. Signed-off-by: Jason Baron --- include/linux/wait.h | 1 + kernel/sched/wait.c | 27 +++ 2 files changed, 28 insertions(+) diff --git a/include/li

Re: [PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-25 Thread Jason Baron
On 02/21/2015 07:24 PM, Eric Wong wrote: > Jason Baron wrote: >> On 02/18/2015 12:51 PM, Ingo Molnar wrote: >>> * Ingo Molnar wrote: >>> >>>>> [...] However, I think the userspace API change is less >>>>> clear since epoll_wait() do

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-02-25 Thread Jason Baron
On 02/25/2015 02:38 AM, Ingo Molnar wrote: > * Jason Baron wrote: > >> Hi, >> >> When we are sharing a wakeup source among multiple epoll >> fds, we end up with thundering herd wakeups, since there >> is currently no way to add to the wakeup source >>

Re: [PATCH v4 0/9] epoll: Introduce new syscalls, epoll_ctl_batch and epoll_pwait1

2015-03-12 Thread Jason Baron
On 03/09/2015 09:49 PM, Fam Zheng wrote: > > Benchmark for epoll_pwait1 > == > > By running fio tests inside VM with both original and modified QEMU, we can > compare their difference in performance. > > With a small VM setup [t1], the original QEMU (ppoll based) has an 4k r

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-03-04 Thread Jason Baron
On 03/04/2015 07:02 PM, Ingo Molnar wrote: > * Andrew Morton wrote: > >> On Fri, 27 Feb 2015 17:01:32 -0500 Jason Baron wrote: >> >>>> I don't really understand the need for rotation/round-robin. We can >>>> solve the thundering herd via exclusive

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-03-05 Thread Jason Baron
On 03/05/2015 04:15 AM, Ingo Molnar wrote: > * Jason Baron wrote: > >> 2) We are using the wakeup in this case to 'assign' work more >> permanently to the thread. That is, in the case of a listen socket >> we then add the connected socket to the woken up thr

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-03-07 Thread Jason Baron
On 03/05/2015 04:15 AM, Ingo Molnar wrote: > * Jason Baron wrote: > >> 2) We are using the wakeup in this case to 'assign' work more >> permanently to the thread. That is, in the case of a listen socket >> we then add the connected socket to the woken up thr

Re: [PATCH v4 0/9] epoll: Introduce new syscalls, epoll_ctl_batch and epoll_pwait1

2015-03-13 Thread Jason Baron
On 03/13/2015 07:31 AM, Fam Zheng wrote: > On Thu, 03/12 11:02, Jason Baron wrote: >> On 03/09/2015 09:49 PM, Fam Zheng wrote: >> >> Hi, >> >> So it sounds like you are comparing original qemu code (which was using >> ppoll) vs. using epoll with these ne

[PATCH 0/2] Add epoll round robin wakeup mode

2015-02-09 Thread Jason Baron
i = 0; i < NUM_THREADS; i++) { pthread_cancel(threads[i]); printf("joined: %d\n", i); printf("event count: %d\n", event_count[i]); total += event_count[i]; if (!event_count[i])

[PATCH 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-09 Thread Jason Baron
iters. The idea is to use this additional heuristic in order minimize wakeup latencies. Signed-off-by: Jason Baron --- fs/eventpoll.c | 25 - include/uapi/linux/eventpoll.h | 6 ++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/fs/eventpoll.c

[PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
desirable. The WQ_FLAG_ROUND_ROBIN is restricted to being exclusive as well, otherwise we do not know who is being woken up. Signed-off-by: Jason Baron --- include/linux/wait.h | 11 +++ kernel/sched/wait.c | 5 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-09 Thread Jason Baron
On 02/09/2015 03:18 PM, Andy Lutomirski wrote: > On 02/09/2015 12:06 PM, Jason Baron wrote: >> Epoll file descriptors that are added to a shared wakeup source are always >> added in a non-exclusive manner. That means that when we have multiple epoll >> fds attached to a shar

Re: [PATCH 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-09 Thread Jason Baron
On 02/09/2015 05:45 PM, Andy Lutomirski wrote: > On Mon, Feb 9, 2015 at 1:32 PM, Jason Baron wrote: >> On 02/09/2015 03:18 PM, Andy Lutomirski wrote: >>> On 02/09/2015 12:06 PM, Jason Baron wrote: >>>> Epoll file descriptors that are added to a shared wakeup source

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
On 02/09/2015 04:50 PM, Peter Zijlstra wrote: > On Mon, Feb 09, 2015 at 08:05:57PM +0000, Jason Baron wrote: >> diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c >> index 852143a..17d1039 100644 >> --- a/kernel/sched/wait.c >> +++ b/kernel/sched/wait.c >&g

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Jason Baron
On 02/10/2015 04:03 AM, Peter Zijlstra wrote: > On Mon, Feb 09, 2015 at 11:06:17PM -0500, Jason Baron wrote: >> On 02/09/2015 04:50 PM, Peter Zijlstra wrote: >>> On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: >>>> diff --git a/kernel/sched/wait.c b/

Re: [PATCH 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-10 Thread Jason Baron
On 02/09/2015 11:49 PM, Eric Wong wrote: > Jason Baron wrote: >> On 02/09/2015 05:45 PM, Andy Lutomirski wrote: >>> On Mon, Feb 9, 2015 at 1:32 PM, Jason Baron wrote: >>>> On 02/09/2015 03:18 PM, Andy Lutomirski wrote: >>>>> On 02/09/2015 1

Re: [PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-18 Thread Jason Baron
On 02/18/2015 12:51 PM, Ingo Molnar wrote: > * Ingo Molnar wrote: > >>> [...] However, I think the userspace API change is less >>> clear since epoll_wait() doesn't currently have an >>> 'input' events argument as epoll_ctl() does. >> ... but the change would be a bit clearer and somewhat >> mo

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-02-27 Thread Jason Baron
On 02/27/2015 04:10 PM, Andrew Morton wrote: > On Wed, 25 Feb 2015 11:27:04 -0500 Jason Baron wrote: > >>> Libenzi inactive eventpoll appears to be without a >>> dedicated maintainer since 2011 or so. Is there anyone who >>> knows the code and its us

Re: [PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-27 Thread Jason Baron
Hi, v3 of this series implements this idea using using a different approach: http://lkml.iu.edu/hypermail/linux/kernel/1502.3/00667.html If that still meets your needs it would be helpful to know in order to move this forward. Looking back at your posting, I was concerned about the test case no

Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode

2015-03-01 Thread Jason Baron
On 02/27/2015 04:31 PM, Jonathan Corbet wrote: > On Fri, 27 Feb 2015 13:10:34 -0800 > Andrew Morton wrote: > >> I don't really understand the need for rotation/round-robin. We can >> solve the thundering herd via exclusive wakeups, but what is the point >> in choosing to wake the task which has b

[PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-17 Thread Jason Baron
iters. The idea is to use this additional heuristic in order minimize wakeup latencies. Signed-off-by: Jason Baron --- fs/eventpoll.c | 25 - include/uapi/linux/eventpoll.h | 6 ++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/fs/eventpoll.c

[PATCH v2 0/2] Add epoll round robin wakeup mode

2015-02-17 Thread Jason Baron
epoll fds to a shared wakeup soruce. Depends on EPOLLEXCLUSIVE being set and must be specified with an EPOLL_CTL_ADD operation. Thanks, -Jason Jason Baron (2): sched/wait: add round robin wakeup mode epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN fs/eventpoll.c

[PATCH v2 1/2] sched/wait: add round robin wakeup mode

2015-02-17 Thread Jason Baron
desirable. The WQ_FLAG_ROUND_ROBIN is restricted to being exclusive as well, otherwise we do not know who is being woken up. Signed-off-by: Jason Baron --- include/linux/wait.h | 11 +++ kernel/sched/wait.c | 10 -- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v2 0/2] Add epoll round robin wakeup mode

2015-02-17 Thread Jason Baron
On 02/17/2015 02:46 PM, Andy Lutomirski wrote: > On Tue, Feb 17, 2015 at 11:33 AM, Jason Baron wrote: >> When we are sharing a wakeup source among multiple epoll fds, we end up with >> thundering herd wakeups, since there is currently no way to add to the >> wakeup source exc

Re: [PATCH v2 0/2] Add epoll round robin wakeup mode

2015-02-17 Thread Jason Baron
On 02/17/2015 04:09 PM, Andy Lutomirski wrote: > On Tue, Feb 17, 2015 at 12:33 PM, Jason Baron wrote: >> On 02/17/2015 02:46 PM, Andy Lutomirski wrote: >>> On Tue, Feb 17, 2015 at 11:33 AM, Jason Baron wrote: >>>> When we are sharing a wakeup source among multiple e

Re: [PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-18 Thread Jason Baron
On 02/18/2015 03:07 AM, Ingo Molnar wrote: > * Jason Baron wrote: > >> Epoll file descriptors that are added to a shared wakeup >> source are always added in a non-exclusive manner. That >> means that when we have multiple epoll fds attached to a >> shared wakeu

Re: [PATCH v2 2/2] epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN

2015-02-18 Thread Jason Baron
On 02/18/2015 11:33 AM, Ingo Molnar wrote: > * Jason Baron wrote: > >>> This has two main advantages: firstly it solves the >>> O(N) (micro-)problem, but it also more evenly >>> distributes events both between task-lists and within >>> epoll groups

Re: [PATCH] epoll: add exclusive wakeups flag

2016-03-10 Thread Jason Baron
Hi Michael, On 01/29/2016 03:14 AM, Michael Kerrisk (man-pages) wrote: > Hello Jason, > On 01/28/2016 06:57 PM, Jason Baron wrote: >> Hi, >> >> On 01/28/2016 02:16 AM, Michael Kerrisk (man-pages) wrote: >>> Hi Jason, >>> >>> On 12/08/2015 04:23 A

Re: [PATCH] epoll: add exclusive wakeups flag

2016-03-10 Thread Jason Baron
On 03/10/2016 02:58 PM, Michael Kerrisk (man-pages) wrote: > On 03/10/2016 07:53 PM, Jason Baron wrote: >> Hi Michael, >> >> On 01/29/2016 03:14 AM, Michael Kerrisk (man-pages) wrote: >>> Hello Jason, >>> On 01/28/2016 06:57 PM, Jason Baron wrote: &g

[PATCH 0/1] mm: setting of min_free_kbytes

2016-04-12 Thread Jason Baron
khugepaged has done in that case to restore the default settings Thanks, -Jason Jason Baron (1): mm: update min_free_kbytes from khugepaged after core initialization mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.6.1

[PATCH 1/1] mm: update min_free_kbytes from khugepaged after core initialization

2016-04-12 Thread Jason Baron
("thp: cleanup khugepaged startup") Signed-off-by: Jason Baron --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 59de90d5d3a3..c1069efcc4d7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6485,7

Re: Use-after-free in ep_remove_wait_queue

2015-11-06 Thread Jason Baron
On 11/06/2015 08:06 AM, Dmitry Vyukov wrote: > On Mon, Oct 12, 2015 at 2:17 PM, Dmitry Vyukov wrote: >> On Mon, Oct 12, 2015 at 2:14 PM, Eric Dumazet wrote: >>> On Mon, 2015-10-12 at 14:02 +0200, Michal Kubecek wrote: >>> Probably the issue discussed in http://thread.gmane.org/gm

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:)

2015-11-20 Thread Jason Baron
On 11/19/2015 06:52 PM, Rainer Weikusat wrote: [...] > @@ -1590,21 +1718,35 @@ restart: > goto out_unlock; > } > > - if (unix_peer(other) != sk && unix_recvq_full(other)) { > - if (!timeo) { > + if (unlikely(unix_peer(other) != sk && unix_recvq_fu

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue

2015-11-23 Thread Jason Baron
still has a pointer to the > corresponding peer_wait queue. There's no way to forcibly deregister a > wait queue with epoll. > > Based on an idea by Jason Baron, the patch below changes the code such > that a wait_queue_t belonging to the client socket is enqueued on the >

[PATCH v4 2/3] net: unix: Convert gc_flags to flags

2015-10-08 Thread Jason Baron
Convert gc_flags to flags in perparation for the subsequent patch, which will make use of a flag bit for a non-gc purpose. Signed-off-by: Jason Baron --- include/net/af_unix.h | 2 +- net/unix/garbage.c| 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a

[PATCH v4 0/3] net: unix: fix use-after-free

2015-10-08 Thread Jason Baron
the peer socket has receive space v3: -beef up memory barrier comments in 3/3 (Peter Zijlstra) -clean up unix_dgram_writable() function in 3/3 (Joe Perches) Jason Baron (3): net: unix: fix use-after-free in unix_dgram_poll() net: unix: Convert gc_flags to flags net: unix: optimize wakeups in

[PATCH v4 1/3] net: unix: fix use-after-free in unix_dgram_poll()

2015-10-08 Thread Jason Baron
epoll(). I've implemented this for sock-type, SOCK_RAW, SOCK_DGRAM, and SOCK_SEQPACKET but not for SOCK_STREAM, since SOCK_STREAM does not use unix_dgram_poll(). Introduced in commit ec0d215f9420 ("af_unix: fix 'poll for write'/connected DGRAM sockets"). Tested-by: Mathias Krau

[PATCH v4 3/3] net: unix: optimize wakeups in unix_dgram_recvmsg()

2015-10-08 Thread Jason Baron
/netdev/msg145533.html Signed-off-by: Jason Baron --- include/net/af_unix.h | 1 + net/unix/af_unix.c| 92 +-- 2 files changed, 69 insertions(+), 24 deletions(-) diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 6a4a345..cf21ffd

Re: [PATCH v4 3/3] net: unix: optimize wakeups in unix_dgram_recvmsg()

2015-10-09 Thread Jason Baron
connect() permanently registers a callback routine, we can induce extra overhead in unix_dgram_recvmsg(), which unconditionally wakes up its peer_wait queue on every receive. This patch makes the wakeup there conditional on there being waiters. Tested using: http://www.spinics.net/lists/netdev/ms

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue

2015-11-09 Thread Jason Baron
corresponding peer_wait queue. There's no way to forcibly deregister a > wait queue with epoll. > > Based on an idea by Jason Baron, the patch below changes the code such > that a wait_queue_t belonging to the client socket is enqueued on the > peer_wait queue of the server wheneve

Re: List corruption on epoll_ctl(EPOLL_CTL_DEL) an AF_UNIX socket

2015-09-29 Thread Jason Baron
On 09/29/2015 02:09 PM, Mathias Krause wrote: > On 14 September 2015 at 04:39, Eric Wong wrote: >> +cc Jason Baron since he might be able to provide more insight into >> epoll. >> >> Mathias Krause wrote: >>> Hi, >>> >>> this is an

Re: List corruption on epoll_ctl(EPOLL_CTL_DEL) an AF_UNIX socket

2015-09-30 Thread Jason Baron
On 09/30/2015 01:54 AM, Mathias Krause wrote: > On 29 September 2015 at 21:09, Jason Baron wrote: >> However, if we call connect on socket 's', to connect to a new socket 'o2', >> we >> drop the reference on the original socket 'o'. Thus, we can

Re: List corruption on epoll_ctl(EPOLL_CTL_DEL) an AF_UNIX socket

2015-09-30 Thread Jason Baron
On 09/30/2015 03:34 AM, Michal Kubecek wrote: > On Wed, Sep 30, 2015 at 07:54:29AM +0200, Mathias Krause wrote: >> On 29 September 2015 at 21:09, Jason Baron wrote: >>> However, if we call connect on socket 's', to connect to a new socket 'o2', >>

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue

2015-11-17 Thread Jason Baron
On 11/15/2015 01:32 PM, Rainer Weikusat wrote: > > That was my original idea. The problem with this is that the code > starting after the _lock and running until the main code path unlock has > to be executed in one go with the other lock held as the results of the > tests above this one may be

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:)

2015-11-17 Thread Jason Baron
corresponding peer_wait queue. There's no way to forcibly deregister a > wait queue with epoll. > > Based on an idea by Jason Baron, the patch below changes the code such > that a wait_queue_t belonging to the client socket is enqueued on the > peer_wait queue of the server wheneve

Re: [PATCH RESEND] fs/epoll: fix the edge-triggered mode for nested epoll

2019-09-03 Thread Jason Baron
1) >>      goto out; >> >> nfds = epoll_wait(efd[0], &e, 1, 0); >> if (nfds != 0) >> goto out; >> >> nfds = epoll_wait(efd[1], &e, 1, 0); >> if (nfds != 1) >> goto out; >> >> n

Re: [PATCH RESEND] fs/epoll: fix the edge-triggered mode for nested epoll

2019-09-04 Thread Jason Baron
On 9/4/19 5:57 AM, Roman Penyaev wrote: > On 2019-09-03 23:08, Jason Baron wrote: >> On 9/2/19 11:36 AM, Roman Penyaev wrote: >>> Hi, >>> >>> This is indeed a bug. (quick side note: could you please remove efd[1] >>> from your test, because it is not

[PATCH] epoll: simplify ep_poll_safewake() for CONFIG_DEBUG_LOCK_ALLOC

2019-09-04 Thread Jason Baron
mirrors a conversion that was done for !CONFIG_DEBUG_LOCK_ALLOC in: commit 37b5e5212a44 ("epoll: remove ep_call_nested() from ep_eventpoll_poll()") Signed-off-by: Jason Baron Cc: Davidlohr Bueso Cc: Roman Penyaev Cc: Al Viro Cc: Eric Wong Cc: Andrew Morton --- fs/eventp

Re: [PATCH RESEND] fs/epoll: fix the edge-triggered mode for nested epoll

2019-09-05 Thread Jason Baron
t;> and any other corner cases needs to be added? >>> >>> https://github.com/heiher/epoll-wakeup/blob/master/README.md >>> >>> On Wed, Sep 4, 2019 at 10:02 PM Heiher wrote: >>> > >>> > Hi, >>> > >>> > On Wed, Sep 4,

Re: [PATCH RESEND] fs/epoll: fix the edge-triggered mode for nested epoll

2019-09-12 Thread Jason Baron
On 9/11/19 4:19 AM, Heiher wrote: > Hi, > > On Fri, Sep 6, 2019 at 1:48 AM Jason Baron wrote: >> >> >> >> On 9/5/19 1:27 PM, Roman Penyaev wrote: >>> On 2019-09-05 11:56, Heiher wrote: >>>> Hi, >>>> >>>> On Thu, S

Re: [PATCH RESEND v4] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-10-03 Thread Jason Baron
On 9/30/19 7:55 AM, Roman Penyaev wrote: > On 2019-09-28 04:29, Andrew Morton wrote: >> On Wed, 25 Sep 2019 09:56:03 +0800 hev wrote: >> >>> From: Heiher >>> >>> Take the case where we have: >>> >>>     t0 >>> | (ew) >>>     e0 >>> | (et) >>>     e1 >>> |

Re: [PATCH RESEND v4] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-10-07 Thread Jason Baron
On 10/7/19 2:30 PM, Roman Penyaev wrote: > On 2019-10-07 18:42, Jason Baron wrote: >> On 10/7/19 6:54 AM, Roman Penyaev wrote: >>> On 2019-10-03 18:13, Jason Baron wrote: >>>> On 9/30/19 7:55 AM, Roman Penyaev wrote: >>>>> On 2019-09-28 04:29, Andre

Re: [PATCH RESEND v4] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-10-07 Thread Jason Baron
On 10/7/19 6:54 AM, Roman Penyaev wrote: > On 2019-10-03 18:13, Jason Baron wrote: >> On 9/30/19 7:55 AM, Roman Penyaev wrote: >>> On 2019-09-28 04:29, Andrew Morton wrote: >>>> On Wed, 25 Sep 2019 09:56:03 +0800 hev wrote: >>>> >>>>&

Re: [PATCH RESEND v2] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-09-24 Thread Jason Baron
On 9/24/19 10:06 AM, Heiher wrote: > Hi, > > On Mon, Sep 23, 2019 at 11:34 PM Jason Baron wrote: >> >> >> >> On 9/20/19 12:00 PM, Jason Baron wrote: >>> On 9/19/19 5:24 AM, hev wrote: >>>> From: Heiher >>>> >>

Re: [PATCH] epoll: simplify ep_poll_safewake() for CONFIG_DEBUG_LOCK_ALLOC

2019-09-24 Thread Jason Baron
On 9/23/19 3:23 PM, Roman Penyaev wrote: > On 2019-09-23 17:43, Jason Baron wrote: >> On 9/4/19 4:22 PM, Jason Baron wrote: >>> Currently, ep_poll_safewake() in the CONFIG_DEBUG_LOCK_ALLOC case uses >>> ep_call_nested() in order to pass the c

Re: [PATCH RESEND v2] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-09-20 Thread Jason Baron
&e, 1, 0) != 1) > goto out; > > if (epoll_wait(efd[0], &e, 1, 0) != 0) > goto out; > > close(efd[0]); > close(efd[1]); > close(sfd[0]); > close(sfd[1]); > > return 0; > > out: > retur

Re: [PATCH RESEND v2] fs/epoll: Remove unnecessary wakeups of nested epoll that in ET mode

2019-09-23 Thread Jason Baron
On 9/20/19 12:00 PM, Jason Baron wrote: > On 9/19/19 5:24 AM, hev wrote: >> From: Heiher >> >> Take the case where we have: >> >> t0 >> | (ew) >> e0 >> | (et) >> e1 >> | (lt) >&

<    1   2   3   4   5   >