Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5331126rwp; Mon, 17 Jul 2023 02:03:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHUocmcoXU8lzIheSEI+aaPFpXJXPKVddNSEd3V+AL8ELIgSEccQq/WJ8re5XlOAP6MdTHQ X-Received: by 2002:a05:6402:74b:b0:51d:a73b:0 with SMTP id p11-20020a056402074b00b0051da73b0000mr12301384edy.10.1689584611081; Mon, 17 Jul 2023 02:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689584611; cv=none; d=google.com; s=arc-20160816; b=S4ytln7RBLXJ+aSXkQvMxcH0ojjl10uq3ilDeLt9z6nGWgvPFye9bf5kPdZyMTn6Pz mFD6AXD/qeIuLnbqzqM8kshp8N9nIme3K/Xw/lLEjcmbfhPDadxbPQaoQSrTw/FOAIBp I5KLFS38W4jlPRIzfqd3eR7pLg/TlbKT+BZWN4MxNJ40KgbruGMKAImaOEU8m3MrbHV4 5Gmmy0rLkl/lnyn+flAWHirLc5S4lI7Tft/3dDKZPj++DmGMqzwYtLSU5QrTXx9hMY1n Jf2VzxyR0jhnYMXaj4X5xM4EOk5bttxR+pJYJPzn8fkRDHyKEvFVO4y+akwNzjwQCB4L H6Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KrEcIar0BkfpmBL+8BCmNKqe2TUSK3LL+WBdNYsOjsM=; fh=Acwuu5WOSNUhKa6Ns5/0gD+bQ6tdq3eDXYFvQHV3XS8=; b=HWiSv4HhtOUFQ7QZtndxdCfD3I63IiuJVLxjwU2jSdmXmsMbUwZqK50ZrSVtvopxs3 oE4v779ehAL3sY/dKzw+R4Y1YMb2SDmKeDsEVxT7zinhJ1hU8XC4FZP/TAR6sFAarbl5 cwSDg809XkGrz56+O/1wyaIU9cZQWFVgV899asxcR3czmikoWI6ghgJuvVRT2wzBnD57 pn23UEHdL6IbqP66HT48Pr8Y0+DbEtxGBrQj0oFgrZxJykcauBN3wq+u/GsO5lG4ElVZ SbqOrWoQbT2aodjJ4ZPlX3TtxfCjO0+DYUw7vHswrjQc7d9eNbgcBOEG3PlsXIqLI6cw Rzew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=e52IJgo7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a50ed0f000000b0051a27469761si13372544eds.123.2023.07.17.02.03.07; Mon, 17 Jul 2023 02:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=e52IJgo7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbjGQI3u (ORCPT + 99 others); Mon, 17 Jul 2023 04:29:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbjGQI3s (ORCPT ); Mon, 17 Jul 2023 04:29:48 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C948618D for ; Mon, 17 Jul 2023 01:29:46 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-345d6dc271dso22491635ab.0 for ; Mon, 17 Jul 2023 01:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; t=1689582586; x=1692174586; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KrEcIar0BkfpmBL+8BCmNKqe2TUSK3LL+WBdNYsOjsM=; b=e52IJgo7nORao0Gl4I5dRpwwbrYRCXZTSuwaC/thRVodGrQS/Ih+iZx/Zsqn89WU3w pQgXUWQS+Vk59/Fh6rrIEqzCQJkEny2i0gy7zEPOvxwj9yUxhnNvrizRbt8YsZpplHpx RjVLFZyrzR9wafddakUgpMo5lLKlNumHP6uiacp/wGVyLbBbCgrHIUP/7snpf7XV2sof jlaeLm95LpwgAuzcjO7UCvT+e3bh2UJ0I6TbCUpKBOZvGLRTw6wJXY5zbY52dacz1/1P iPPOvh8ArwyYCroEOLn3Y8OJKVgd78PUACDF8tTPiPB+Om3hyy+66x8dhT2yU/74h83y v2JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689582586; x=1692174586; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KrEcIar0BkfpmBL+8BCmNKqe2TUSK3LL+WBdNYsOjsM=; b=KJLybhDP7MRfPVpWwViaAdGeubPi45j1C9hLUGU1/hpjF8H6R22BAVbxKXIjwakzSU ZNNwMkh942LHKMK88uye1vbwTtvSvHXF4Msh7InXLoCguG3nE354Yr4lOVFIcAmESfP1 GV94ZTDrHZrPDTpCatXjRjzcFKIYl6T7jGkBR3d4UpvZcI4pMPUauMSItKf2fb8FwJSe CRDqk2qz6vMW5IjBquY4cKruMQl+mw65CaVj+Mct6Asti4GOVt/p1Y9EdgcMd60/wmQh bo4VhqEi0XlVIP6niz5/jC6ATKm6p2vKHlohaZYvMyMJuZjnbivgTX2fHTflwUuct6s5 8BIg== X-Gm-Message-State: ABy/qLZyoCVki0bRTdCzpqnH454F7SW/A0mCaRT9Jhk1hzNPTetJlpld xZT22qPU2K6TcypAaLVNMYogibG1ZpKioTeRMEe/Og== X-Received: by 2002:a92:d4d2:0:b0:345:d470:baa6 with SMTP id o18-20020a92d4d2000000b00345d470baa6mr9664500ilm.29.1689582586220; Mon, 17 Jul 2023 01:29:46 -0700 (PDT) MIME-Version: 1.0 References: <20230630155936.3015595-1-jaz@semihalf.com> <20230714-gauner-unsolidarisch-fc51f96c61e8@brauner> In-Reply-To: <20230714-gauner-unsolidarisch-fc51f96c61e8@brauner> From: Grzegorz Jaszczyk Date: Mon, 17 Jul 2023 10:29:34 +0200 Message-ID: Subject: Re: [PATCH 0/2] eventfd: simplify signal helpers To: Christian Brauner , Alex Williamson Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-usb@vger.kernel.org, Matthew Rosato , Paul Durrant , Tom Rix , Jason Wang , dri-devel@lists.freedesktop.org, Michal Hocko , linux-mm@kvack.org, Kirti Wankhede , Paolo Bonzini , Jens Axboe , Vineeth Vijayan , Diana Craciun , Alexander Gordeev , Xuan Zhuo , Shakeel Butt , Vasily Gorbik , Leon Romanovsky , Harald Freudenberger , Fei Li , x86@kernel.org, Roman Gushchin , Halil Pasic , Jason Gunthorpe , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian Borntraeger , linux-fpga@vger.kernel.org, Zhi Wang , Wu Hao , Jason Herne , Eric Farman , Dave Hansen , Andrew Donnellan , Arnd Bergmann , linux-s390@vger.kernel.org, Heiko Carstens , Johannes Weiner , linuxppc-dev@lists.ozlabs.org, Eric Auger , Borislav Petkov , kvm@vger.kernel.org, Rodrigo Vivi , cgroups@vger.kernel.org, Thomas Gleixner , virtualization@lists.linux-foundation.org, intel-gvt-dev@lists.freedesktop.org, io-uring@vger.kernel.org, netdev@vger.kernel.org, Tony Krowiak , Tvrtko Ursulin , Pavel Begunkov , Sean Christopherson , Oded Gabbay , Muchun Song , Peter Oberparleiter , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Benjamin LaHaise , "Michael S. Tsirkin" , Sven Schnelle , Greg Kroah-Hartman , Frederic Barrat , Moritz Fischer , Vitaly Kuznetsov , David Woodhouse , Xu Yilun , Dominik Behr , Marcin Wojtas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 14 lip 2023 o 09:05 Christian Brauner napisa=C5= =82(a): > > On Thu, Jul 13, 2023 at 11:10:54AM -0600, Alex Williamson wrote: > > On Thu, 13 Jul 2023 12:05:36 +0200 > > Christian Brauner wrote: > > > > > Hey everyone, > > > > > > This simplifies the eventfd_signal() and eventfd_signal_mask() helper= s > > > by removing the count argument which is effectively unused. > > > > We have a patch under review which does in fact make use of the > > signaling value: > > > > https://lore.kernel.org/all/20230630155936.3015595-1-jaz@semihalf.com/ > > Huh, thanks for the link. > > Quoting from > https://patchwork.kernel.org/project/kvm/patch/20230307220553.631069-1-ja= z@semihalf.com/#25266856 > > > Reading an eventfd returns an 8-byte value, we generally only use it > > as a counter, but it's been discussed previously and IIRC, it's possibl= e > > to use that value as a notification value. > > So the goal is to pipe a specific value through eventfd? But it is > explicitly a counter. The whole thing is written around a counter and > each write and signal adds to the counter. > > The consequences are pretty well described in the cover letter of > v6 https://lore.kernel.org/all/20230630155936.3015595-1-jaz@semihalf.com/ > > > Since the eventfd counter is used as ACPI notification value > > placeholder, the eventfd signaling needs to be serialized in order to > > not end up with notification values being coalesced. Therefore ACPI > > notification values are buffered and signalized one by one, when the > > previous notification value has been consumed. > > But isn't this a good indication that you really don't want an eventfd > but something that's explicitly designed to associate specific data with > a notification? Using eventfd in that manner requires serialization, > buffering, and enforces ordering. > > I have no skin in the game aside from having to drop this conversion > which I'm fine to do if there are actually users for this btu really, > that looks a lot like abusing an api that really wasn't designed for > this. https://patchwork.kernel.org/project/kvm/patch/20230307220553.631069-1-jaz@= semihalf.com/ was posted at the beginig of March and one of the main things we've discussed was the mechanism for propagating acpi notification value. We've endup with eventfd as the best mechanism and have actually been using it from v2. I really do not want to waste this effort, I think we are quite advanced with v6 now. Additionally we didn't actually modify any part of eventfd support that was in place, we only used it in a specific (and discussed beforehand) way.