Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1629656ybt; Mon, 15 Jun 2020 05:34:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/CTK4dEk31xfk7OwUcrW0aKf7oZjWLkPLVo16GpxdSNh0QhlWX478uZlegzDuHZa5VzS9 X-Received: by 2002:aa7:df96:: with SMTP id b22mr24039081edy.348.1592224471351; Mon, 15 Jun 2020 05:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592224471; cv=none; d=google.com; s=arc-20160816; b=QfbNVGnjCM8obnbehXchFqtfZAKyZb8ilU+HJD2NYlVZhWGw1tb6r9bg9uURq2tH/t F/W4sLT9NtfcHvTPlXnCcDVs8Nzr8dwqJSJ2PFzf7u7Oz3WY4/akltgpQeqAKLgOQmqE FW982Aku1VjwMWLQ1kbFLId61+abfNj4DNW9E/BCOpAo2ObbPZgbnYvcPGV98tCrSU3G jsdr0sHCnAnsJiudgpQS3Zyczsu/NJML0MCmksLwHLokhwK+dfPcauWkr833YKVhfz2i /Ss11EsPn2qyepTxhes2KcYuRaPoXq1yi52EFFwy/x3+af6zTpt19ETawZPuiDiEcIk4 YtUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=R86wgNjo/pUDkredCPnF7v+QqcZWb2dsCbc+4OBYt1s=; b=f3dCOn9x46p0MWoIj3m6IdvLjxG6QvMzjzLfvB6fZqutu5kt/I2rMTt4yUudJPpMMp 6Us0G3ERqW+yAHmC7B6QCGSOdjqpKmvvWBTAqsxNlFrcRCA4fqHp8rjWNNtJZSbfDx6/ Ox3wub6L653NQQcjgln/RR5yfuiGCGCWAnAn2uUGEhTF2rV3z5mANv24c0TNCf+KNM3D evKOYdb3mGTQSzjiO4hnYZNYnLTFBVPyT4KC4quslRiX1xbMNmUQCxsHzr/RHPngGC1L tGBxgJwLJd/kwZIbj7r1sNW8d6auJRy1v+82wBuYei/dzVHTVT+4jlOw2ZJM5wjo4uwk kU5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R2JQ+ovt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si8475769ejs.733.2020.06.15.05.34.07; Mon, 15 Jun 2020 05:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R2JQ+ovt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729934AbgFOMa4 (ORCPT + 99 others); Mon, 15 Jun 2020 08:30:56 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:53004 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728285AbgFOMaz (ORCPT ); Mon, 15 Jun 2020 08:30:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592224254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R86wgNjo/pUDkredCPnF7v+QqcZWb2dsCbc+4OBYt1s=; b=R2JQ+ovtEli3Hvtc0Vsx7uAzuA4rXd59nL7s2zHxvhfl9VdoE+Ly7wvX5vI/O8CTkvkDZl YN3JrmfjX/vof3zrtt4K36nGLhWG0I4C6eL/x81oIkYDk71HPmLhOi1gweVyYET9gfcIMx z7CdxgcwzzQeWsl5YEr8dBSvEk3mAXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-kPdSEbhUPzGpHFB6K8YPdw-1; Mon, 15 Jun 2020 08:30:52 -0400 X-MC-Unique: kPdSEbhUPzGpHFB6K8YPdw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3860A108BD1D; Mon, 15 Jun 2020 12:30:51 +0000 (UTC) Received: from krava (unknown [10.40.192.59]) by smtp.corp.redhat.com (Postfix) with SMTP id 6CD307CAA9; Mon, 15 Jun 2020 12:30:49 +0000 (UTC) Date: Mon, 15 Jun 2020 14:30:48 +0200 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v7 01/13] tools/libperf: introduce notion of static polled file descriptors Message-ID: <20200615123048.GB2088119@krava> References: <5de4b954-24f0-1e8d-5a0d-7b12783b8218@linux.intel.com> <3c92a0ad-d7d3-4e78-f0b8-1d3a7122c69e@linux.intel.com> <20200605105051.GA1404794@krava> <20200605113834.GC1404794@krava> <49eca46e-4d0e-2ae5-d7d9-e37a4d680270@linux.intel.com> <20200608084344.GA1520715@krava> <2d80a43a-54cf-3d12-92fd-066217c95d76@linux.intel.com> <20200608160758.GD1558310@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 08:20:38AM +0300, Alexey Budankov wrote: > > On 08.06.2020 19:07, Jiri Olsa wrote: > > On Mon, Jun 08, 2020 at 12:54:31PM +0300, Alexey Budankov wrote: > >> > >> On 08.06.2020 11:43, Jiri Olsa wrote: > >>> On Mon, Jun 08, 2020 at 11:08:56AM +0300, Alexey Budankov wrote: > >>>> > >>>> On 05.06.2020 19:15, Alexey Budankov wrote: > >>>>> > >>>>> On 05.06.2020 14:38, Jiri Olsa wrote: > > >>>>> revents = fdarray_fixed_revents(array, pos); > >>>>> fdarray__del(array, pos); > >>>> > >>>> So how is it about just adding _revents() and _del() for fixed fds with > >>>> correction of retval to bool for fdarray__add()? > >>> > >>> I don't like the separation for fixed and non-fixed fds, > >>> why can't we make generic? > >> > >> Usage models are different but they want still to be parts of the same class > >> for atomic poll(). The distinction is filterable vs. not filterable. > >> The distinction should be somehow provided in API. Options are: > >> 1. expose separate API calls like __add_nonfilterable(), __del_nonfilterable(); > >> use nonfilterable quality in __filter() and __poll() and, perhaps, other internals; > >> 2. extend fdarray__add(, nonfilterable) with the nonfilterable quality > >> use the type in __filter() and __poll() and, perhaps, other internals; > >> expose less API calls in comparison with option 1 > >> > >> Exposure of pos for filterable fds should be converted to bool since currently > >> the returned pos can become stale and there is no way in API to check its state. > >> So it could look like this: > >> > >> fdkey = fdarray__add(array, fd, events, type) > >> type: filterable, nonfilterable, somthing else > >> revents = fdarray__get_revents(fdkey); > >> fdarray__del(array, fdkey); > > > > I think there's solution without having filterable type, > > I'm not sure why you think this is needed > > > > I'm busy with other things this week, but I think I can > > come up with some patch early next week if needed > > Friendly reminder. hm? I believe we discussed this in here: https://lore.kernel.org/lkml/20200609145611.GI1558310@krava/ jirka