From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E575C2D0A3 for ; Fri, 6 Nov 2020 10:17:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDB40206CB for ; Fri, 6 Nov 2020 10:17:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZWHrp7TN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbgKFKR3 (ORCPT ); Fri, 6 Nov 2020 05:17:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23458 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgKFKR2 (ORCPT ); Fri, 6 Nov 2020 05:17:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604657847; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c98dQk0zLTrCO2oJzlMdSO4XNM0SU0ansCker4yytFo=; b=ZWHrp7TNa0iuaxhzjaD00CUYWLsT5VjYAuM5qlDtLTi4OCkapqUYR4LJLsm1fV4pKZUulT rBCRqlmOa82nN+P7RtDT+Bk6G2oG/2K9ryqhsPWgBu78i+88Z0OxCDOb/9vKkTFWNvwSRH 92dGbo9b/RzPkx2mZLJU8O0UTlhboRc= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-fvr_DNVMOaOIkoDOkcwX1g-1; Fri, 06 Nov 2020 05:17:25 -0500 X-MC-Unique: fvr_DNVMOaOIkoDOkcwX1g-1 Received: by mail-wm1-f70.google.com with SMTP id z62so378184wmb.1 for ; Fri, 06 Nov 2020 02:17:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c98dQk0zLTrCO2oJzlMdSO4XNM0SU0ansCker4yytFo=; b=N9eCxNlqvrS3XxCWKJk4dO2gSMopN7Ly6tO3ODJ0tm3x1djrs3LUuydqBEDfbBgPbz WjSjhcW9lxounus0HkgBVQj7YoNROrM/7jtZ5kf1X28JkIWXvXNe55Ka0pOJDQ2edySn 0FGw62cvcNhPtwmX3ZFM/tpvDqzvpYW+9HY5nQ/RT0P8MkdOQxrgZuYI1OybGdh/6ViX EUXaIU4UgJqWLfzN9ePZbAidI6FgUFMrUdJ+E+a7LS3nTtp8ZvuL3TSXRqasm0w/HZTP CdYnPU/RE+3gPCpUy5YZdi6TNcEL+rQ/cuHEVK2k1neG10JDQl1nGzIE8Gf9jt6SE2Kr xAsw== X-Gm-Message-State: AOAM530lk4ATqHXu04ZLN27QYK8950eSANVGrgPAarQ9Aa3Ap7KpwxyT FrQvPDbb0Ne/OV99VixwysdUb03APhX3e5CpuUKSpfhlLnAi5+u1aKtpFcgG5wJAgxVXHmQkLFL NBRDfzHXBPhAq X-Received: by 2002:adf:f643:: with SMTP id x3mr1943817wrp.180.1604657844088; Fri, 06 Nov 2020 02:17:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwG3yefM6iYrAHyW3FdeRueDAy5/yBY0Kpc+zqzk+vfI5Ny0ljW2fbQMUCzV0oL7AHKxkNJ1A== X-Received: by 2002:adf:f643:: with SMTP id x3mr1943794wrp.180.1604657843907; Fri, 06 Nov 2020 02:17:23 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id g23sm1535168wmh.21.2020.11.06.02.17.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Nov 2020 02:17:23 -0800 (PST) Subject: Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority() To: David Woodhouse , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , kvm@vger.kernel.org, Alex Williamson References: <20201026175325.585623-1-dwmw2@infradead.org> <20201027143944.648769-1-dwmw2@infradead.org> <20201027143944.648769-2-dwmw2@infradead.org> <20201028143509.GA2628@hirez.programming.kicks-ass.net> From: Paolo Bonzini Message-ID: Date: Fri, 6 Nov 2020 11:17:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 04/11/20 10:35, David Woodhouse wrote: > On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: >> On Tue, Oct 27, 2020 at 02:39:43PM +0000, David Woodhouse wrote: >>> From: David Woodhouse >>> >>> This allows an exclusive wait_queue_entry to be added at the head of the >>> queue, instead of the tail as normal. Thus, it gets to consume events >>> first without allowing non-exclusive waiters to be woken at all. >>> >>> The (first) intended use is for KVM IRQFD, which currently has >>> inconsistent behaviour depending on whether posted interrupts are >>> available or not. If they are, KVM will bypass the eventfd completely >>> and deliver interrupts directly to the appropriate vCPU. If not, events >>> are delivered through the eventfd and userspace will receive them when >>> polling on the eventfd. >>> >>> By using add_wait_queue_priority(), KVM will be able to consistently >>> consume events within the kernel without accidentally exposing them >>> to userspace when they're supposed to be bypassed. This, in turn, means >>> that userspace doesn't have to jump through hoops to avoid listening >>> on the erroneously noisy eventfd and injecting duplicate interrupts. >>> >>> Signed-off-by: David Woodhouse >> >> Acked-by: Peter Zijlstra (Intel) > > Thanks. Paolo, the conclusion was that you were going to take this set > through the KVM tree, wasn't it? > Queued, except for patch 2/3 in the eventfd series which Alex hasn't reviewed/acked yet. Paolo