Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1717623ybt; Mon, 15 Jun 2020 07:42:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIqO4Y4G6LhoTRYNUgTckp2tgB5ffKpPlJi10KIuqcMjJjmaBqj9I3Kd05u61uZmC0++gw X-Received: by 2002:a05:6402:1ca2:: with SMTP id cz2mr23003234edb.15.1592232128819; Mon, 15 Jun 2020 07:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592232128; cv=none; d=google.com; s=arc-20160816; b=t/ipvWA9vTqUtuK6Ii38bZJAD5p0nU3C3NbFzW+IR6nQuKTucYHOUfsmkuRkzOHvx1 RkiJU/4K80vBKZ/m3CY57fMLqJ5cIdwJ+yWx+c7WCYYE0lsTrt/BwXp8zis7c0qYGU9T pij0w62D7COlip7yKLXQrOwMtBCjQ0d3odliC9LiMUNP5M5q5ztpbrilLCAuqvsuNwVC 8eCHj1aEju29rEF3beknWM7+R+Wil0Ulu0OW6/A75/UNoyjbZ6uQ9v08D6BeRIDOso0c mDKbwpMRm2/KZjFAuLHuvElrNeTxQi82fBK9IRYsULDF8W6VcyLAvq/KAeWlQQkZMsnZ FEmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=eIGPhtpoQ3b8Cczjsh7auXj0nj55mKwvyIL3hKfr11s=; b=J6RghZSqsE7s/PZBj7dnj7rA6ZFc0tGKR/yAeb1qsye24xzWZv1NijOr0xURsjkRRc JrCuIKn6cDcJykWJ6LIKANu5eh90Zio8UklA79o3yk6vtfQjjLHvkMFDS5EyXZDBv94D FTm9Obg/w1PQIUXS4n/TZzrVEFJEwIlYzqayPedO+9oVGsjvlRZgVWAVSp6SqBfIOzG9 DFmn8r3bEn2qFvY4/+nSrCDp0wyMAMPk3kFvMw95z1aIF8+xe3mPIYgn1MPjCQHK9KlO jBc5YPihPP0QDMIsDptj7ugDgLof0Lhlc4kW16ZaGGMC9rRiWDXx1Abr/eJree9gNcfn p7vg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si9335389ejz.660.2020.06.15.07.41.45; Mon, 15 Jun 2020 07:42:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730576AbgFOOh5 (ORCPT + 99 others); Mon, 15 Jun 2020 10:37:57 -0400 Received: from mga05.intel.com ([192.55.52.43]:2654 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730353AbgFOOh5 (ORCPT ); Mon, 15 Jun 2020 10:37:57 -0400 IronPort-SDR: h3stUm/CZrdTIziMwB+c9BTDUL1JFocgWdhQ36MfzLQyJbfCPUqpVLgKzF3Ca4CWqGKTN2k1wd 5ysEacp0vYdQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 07:37:56 -0700 IronPort-SDR: HDmyH6Zd5XJufDTOy4f5Xd7UADrGqZ8lXpJOBhuqhz0Ql7RwxgdACz7uySYMjKgu4HDmOVEup0 M+puvSTr+AMg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,514,1583222400"; d="scan'208";a="308145953" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 15 Jun 2020 07:37:56 -0700 Received: from [10.249.225.172] (abudanko-mobl.ccr.corp.intel.com [10.249.225.172]) by linux.intel.com (Postfix) with ESMTP id AC5A8580698; Mon, 15 Jun 2020 07:37:54 -0700 (PDT) Subject: Re: [PATCH v7 01/13] tools/libperf: introduce notion of static polled file descriptors To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel 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> <20200615123048.GB2088119@krava> From: Alexey Budankov Organization: Intel Corp. Message-ID: <8b29e324-eb8d-2266-562b-ca46aec76a3e@linux.intel.com> Date: Mon, 15 Jun 2020 17:37:53 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200615123048.GB2088119@krava> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.06.2020 15:30, Jiri Olsa wrote: > 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/ Do you want it to be implemented like in the patch posted by the link? ~Alexey > > jirka >