Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdHDIIt (ORCPT ); Fri, 4 Aug 2017 04:08:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44454 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751283AbdHDIIq (ORCPT ); Fri, 4 Aug 2017 04:08:46 -0400 Date: Fri, 4 Aug 2017 13:37:48 +0530 From: "Naveen N. Rao" To: Vince Weaver Cc: Peter Zijlstra , Jiri Olsa , Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] kernel/events: Add option to notify through signals on wakeup References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170714 (1.8.3) X-TM-AS-MML: disable x-cbid: 17080408-0004-0000-0000-000002297930 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080408-0005-0000-0000-00005E0F23DC Message-Id: <20170804080748.c3lxlsbim4tzg45y@naverao1-tp.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-04_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708040122 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1711 Lines: 43 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