All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: Use case for TASKS_RCU
Date: Tue, 23 May 2017 19:47:20 -0400	[thread overview]
Message-ID: <20170523194720.4d7ddb7c@vmware.local.home> (raw)
In-Reply-To: <20170523211009.GX3956@linux.vnet.ibm.com>

On Tue, 23 May 2017 14:10:09 -0700
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:

> On Tue, May 23, 2017 at 04:38:53PM -0400, Steven Rostedt wrote:
> > On Tue, 23 May 2017 13:00:35 -0700
> > "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> > 
> >   
> > > > > Unfortunately, it does not work, as I should have known ahead
> > > > > of time from the dyntick-idle experience.  Not all context
> > > > > switches go through context_switch().  :-/    
> > > > 
> > > > Wait. What context switch doesn't go through a context switch?
> > > > Or do you mean a user/kernel context switch?    
> > > 
> > > I mean that putting printk() before and after the call to
> > > context_switch() can show tasks switching out twice without
> > > switching in and vice versa. No sign of lost printk()s, and I
> > > also confirmed this behavior using a flag in task_struct.  
> > 
> > I hope you meant trace_printk()s' as printk is a huge overhead and
> > can cause side effects.  
> 
> Not so much during boot.  But actually, I meant to ask you about
> that...
> 
> >From what I can see from the ftrace documentation, booting with
> >something  
> like this:
> 
> ftrace=function
> ftrace_filter=tasks_rcu_qs,tasks_rcu_qs_enter,tasks_rcu_qs_exit

After the machine is booted, can you make sure those exist for tracing?

 # grep rcu_qs /sys/kernel/debug/tracing/available_filter_functions

> 
> Should enable ftrace, but only on the three functions called out.
> But when I try this, I get the following in dmesg:
> 
> [    1.506171] ftrace bootup tracer 'function' not registered

Can you send me your config.

-- Steve

> 
> And I don't get anything from ftrace_dump() later on.
> 
> What am I doing wrong here?  (Event tracing has worked for me in the
> past from the boot line, but I was lazy so just fell back to printk().
> And I didn't think of trace_printk().)
> 
> > > One way that this can happen on some architectures is via the
> > > "helper" mechanism, where the task sleeps normally, but where a
> > > later interrupt or exception takes on its context "behind the
> > > scenes" in the arch code. This is what messed up my attempt to
> > > use a simple interrupt-nesting counter for RCU dynticks some
> > > years back.  What I counted on there was that the idle loop would
> > > never do that sort of thing, so I could zero the count when
> > > entering idle from process context.
> > > 
> > > But I have not yet found a similar trick for counting voluntary
> > > context switches.
> > > 
> > > I also tried making context_switch() look like a momentary
> > > quiescent state, but of course that means that tasks that block
> > > forever also block the grace period forever.  At which point, I
> > > need to scan the task list to find them.  And that pretty much
> > > brings me back to the current RCU-tasks implementation.  :-/  
> > 
> > Nothing should block in a preempted state forever, and if it does,
> > that means we want to wait forever. Because it could be preempted
> > on the trampoline.  
> 
> Blocking in a preempted state is not the problem here.  Given that
> the obvious hooks don't seem to be catching all of the switch-to and
> switch-from events, blocking forever in a not-preempted state is
> the problem.  I either need some way to see all of the switch-from
> and switch-to events (and the ways I can see to do this have
> patch-size and maintainability issues), or I need to go back to
> scanning the task list.
> 
> And of course, all of the approaches that update state upon context
> switch are slowing down a fastpath for the benefit of a slowpath,
> which is not necessarily all that good of a thing.
> 
> 							Thanx, Paul

  reply	other threads:[~2017-05-23 23:47 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 18:23 Use case for TASKS_RCU Paul E. McKenney
2017-05-15 18:48 ` Steven Rostedt
2017-05-15 20:12   ` Paul E. McKenney
2017-05-16  6:22 ` Ingo Molnar
2017-05-16 12:23   ` Paul E. McKenney
2017-05-16 13:07     ` Steven Rostedt
2017-05-24  9:37       ` Masami Hiramatsu
2017-05-19  6:23     ` Ingo Molnar
2017-05-19 13:35       ` Paul E. McKenney
2017-05-19 14:04         ` Steven Rostedt
2017-05-19 14:23           ` Steven Rostedt
2017-05-19 19:06             ` Paul E. McKenney
2017-05-23  0:00               ` Paul E. McKenney
2017-05-23  5:19                 ` Steven Rostedt
2017-05-23 15:33                   ` Paul E. McKenney
2017-05-23 19:39                 ` Steven Rostedt
2017-05-23 20:00                   ` Paul E. McKenney
2017-05-23 20:38                     ` Steven Rostedt
2017-05-23 21:10                       ` Paul E. McKenney
2017-05-23 23:47                         ` Steven Rostedt [this message]
2017-05-24  1:12                           ` Paul E. McKenney
2017-05-23 20:09 [PATCH 3.18 00/59] 3.18.55-stable review Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 01/59] USB: ene_usb6250: fix DMA to the stack Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 02/59] watchdog: pcwd_usb: fix NULL-deref at probe Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 03/59] char: lp: fix possible integer overflow in lp_setup() Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 04/59] USB: core: replace %p with %pK Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 05/59] dm btree: fix for dm_btree_find_lowest_key() Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 06/59] dm bufio: avoid a possible ABBA deadlock Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 07/59] dm thin metadata: call precommit before saving the roots Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 08/59] dm space map disk: fix some book keeping in the disk space map Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 09/59] mwifiex: pcie: fix cmd_buf use-after-free in remove/reset Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 11/59] regulator: tps65023: Fix inverted core enable logic Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 12/59] ath9k_htc: fix NULL-deref at probe Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 13/59] cdc-acm: fix possible invalid access when processing notification Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 14/59] of: fix sparse warning in of_pci_range_parser_one Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 15/59] of: fdt: add missing allocation-failure check Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 16/59] iio: dac: ad7303: fix channel description Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 17/59] pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 18/59] USB: serial: ftdi_sio: fix setting latency for unprivileged users Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 19/59] USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 20/59] usb: host: xhci-plat: propagate return value of platform_get_irq() Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 21/59] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 22/59] net: irda: irda-usb: fix firmware name on big-endian hosts Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 23/59] [media] usbvision: fix NULL-deref at probe Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 24/59] [media] mceusb: " Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 25/59] [media] ttusb2: limit messages to buffer size Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 26/59] usb: musb: tusb6010_omap: Do not reset the other directions packet size Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 27/59] USB: iowarrior: fix info ioctl on big-endian hosts Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 28/59] usb: serial: option: add Telit ME910 support Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 30/59] USB: serial: mct_u232: fix big-endian baud-rate handling Greg Kroah-Hartman
2017-05-23 20:09 ` [PATCH 3.18 31/59] USB: serial: io_ti: fix div-by-zero in set_termios Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 32/59] USB: hub: fix SS hub-descriptor handling Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 33/59] USB: hub: fix non-SS " Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 34/59] tty: Prevent ldisc drivers from re-using stale tty fields Greg Kroah-Hartman
2017-05-24 13:44   ` Alan Cox
2017-05-24 15:03     ` Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 36/59] iio: proximity: as3935: fix as3935_write Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 37/59] [media] gspca: konica: add missing endpoint sanity check Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 38/59] [media] s5p-mfc: Fix unbalanced call to clock management Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 39/59] [media] dib0700: fix NULL-deref at probe Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 40/59] [media] zr364xx: enforce minimum size when reading header Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 41/59] [media] cx231xx-cards: fix NULL-deref at probe Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 42/59] [media] cx231xx-audio: " Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 43/59] powerpc/pseries: Fix of_node_put() underflow during DLPAR remove Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 44/59] ARM: dts: at91: sama5d3_xplained: fix ADC vref Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 45/59] ARM: dts: at91: sama5d3_xplained: not all ADC channels are available Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 46/59] arm64: uaccess: ensure extension of access_ok() addr Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 47/59] arm64: documentation: document tagged pointer stack constraints Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 48/59] xc2028: Fix use-after-free bug properly Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 49/59] mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 50/59] metag/uaccess: Fix access_ok() Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 51/59] metag/uaccess: Check access_ok in strncpy_from_user Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 52/59] stackprotector: Increase the per-task stack canarys random range from 32 bits to 64 bits on 64-bit platforms Greg Kroah-Hartman
2017-05-23 20:10   ` [kernel-hardening] " Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 53/59] uwb: fix device quirk on big-endian hosts Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 54/59] osf_wait4(): fix infoleak Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 55/59] tracing/kprobes: Enforce kprobes teardown after testing Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 56/59] PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 58/59] drivers: char: mem: Check for address space wraparound with mmap() Greg Kroah-Hartman
2017-05-23 20:10 ` [PATCH 3.18 59/59] usb: misc: legousbtower: Fix memory leak Greg Kroah-Hartman
2017-05-24 15:45 ` [PATCH 3.18 00/59] 3.18.55-stable review Guenter Roeck

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=20170523194720.4d7ddb7c@vmware.local.home \
    --to=rostedt@goodmis.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=mhiramat@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.