Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1703769

Re: [PATCH v2 1/2] kernel/events: Add option to notify through signals on wakeup

From "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] kernel/events: Add option to notify through signals on wakeup
Date 2017-08-04 10:10 +0200
Message-ID <uaFQd-4tx-1@gated-at.bofh.it> (permalink)
References <u9GEH-5cQ-15@gated-at.bofh.it> <u9GEG-5cQ-13@gated-at.bofh.it> <uaszE-3m4-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Vince,
Thanks for taking a look.

On 2017/08/03 01:57PM, Vince Weaver wrote:
> On Tue, 1 Aug 2017, Naveen N. Rao wrote:
> 
> > Add a new option 'signal_on_wakeup' to request for a signal to be
> > delivered on ring buffer wakeup controlled through watermark and
> > {wakeup_events, wakeup_watermark}. HUP is signaled on exit.
> > 
> > Setting signal_on_wakeup disables use of IOC_REFRESH to control signal
> > delivery, instead relying on IOC_ENABLE/DISABLE.
> 
> so I probably missed the original thread on this new interface, but why is 
> IOC_REFRESH not being used?

IOC_REFRESH is used to control the number of overflows before disabling 
the event. It works outside of perf_event_attr in the sense that it 
enables POLL_IN on each overflow and user specifies the number of 
overflows after which to disable the event as part of the ioctl (when 
HUP is signaled).

However, signal_on_wakeup is designed to work with the values in the 
perf_event_attr structure itself. wakeup_events controls the number of 
events after which to signal POLL_IN. signal_on_wakeup itself needs to 
be specified in the perf_event_attr. As such, I felt it is better to 
have all control through perf_event_attr.

But, if you think having IOC_REFRESH available in this scenario is 
useful, we can revisit this. Ideally, we would have separate ioctls to 
control signal delivery separate from perf_event_attr, but I am not sure 
how useful that would be.

> 
> For new interfaces like this it's also nice to have some text that can be 
> added to the perf_event_open() manpage, especially if there's weird 
> conditions like this.

Sure -- I will send an update to the manpage once this series gets 
accepted.

Thanks,
Naveen

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] Notifications for perf sideband events "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-01 16:50 +0200
  [PATCH v2 1/2] kernel/events: Add option to notify through signals on wakeup "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-01 16:50 +0200
    Re: [PATCH v2 1/2] kernel/events: Add option to notify through  signals on wakeup Vince Weaver <vincent.weaver@maine.edu> - 2017-08-03 20:00 +0200
      Re: [PATCH v2 1/2] kernel/events: Add option to notify through  signals on wakeup "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-04 10:10 +0200
    Re: [PATCH v2 1/2] kernel/events: Add option to notify through  signals on wakeup Peter Zijlstra <peterz@infradead.org> - 2017-08-04 12:30 +0200
      Re: [PATCH v2 1/2] kernel/events: Add option to notify through  signals on wakeup "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-04 19:40 +0200
  [PATCH v2 2/2] kernel/events: Add option to enable counting sideband events in wakeup_events "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-01 16:50 +0200
    Re: [PATCH v2 2/2] kernel/events: Add option to enable counting  sideband events in wakeup_events Peter Zijlstra <peterz@infradead.org> - 2017-08-04 13:00 +0200
      Re: [PATCH v2 2/2] kernel/events: Add option to enable counting  sideband events in wakeup_events "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-08-04 20:20 +0200

csiph-web