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=unavailable 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 BE108C388F2 for ; Fri, 6 Nov 2020 10:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D305206CB for ; Fri, 6 Nov 2020 10:17:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RQLIKFiz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbgKFKRb (ORCPT ); Fri, 6 Nov 2020 05:17:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37363 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgKFKRa (ORCPT ); Fri, 6 Nov 2020 05:17:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604657848; 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=RQLIKFizm53rdsRN0fGIIsjHpuYHCSDt1gTG4q2zRz3rdn1VHBaliIfn/eWx5ENlBTqbjU oiB7gQvbnq6wHNnn1ZurtdpIxflklnpS3uHRu8JY3T+TJ1N2oNrTBNcXpvC2tdeg3t9qJr zk49+GYK/aanjs+oZ3PuHdvcosN0MI0= 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-327-FOMsOOELObGrZcMZo2f3uw-1; Fri, 06 Nov 2020 05:17:25 -0500 X-MC-Unique: FOMsOOELObGrZcMZo2f3uw-1 Received: by mail-wm1-f70.google.com with SMTP id a130so380803wmf.0 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=OYLMz7MV6lEI310427je2gTkqnOH95VVRyuVLtEkf704PJL+n/2dWtK7f72sepALTU J6ko0tac0Fhf1SAj7KS4TDv3Jf+PYFPk98hW2NJBE/zBRK5sWEs5dJqJD86P406MJnK/ CB8Fp2ouqyNAnf/sbRbQefFtzyWIKHgdv2qHrVPcRt45g9kyQ9je9yDmjNg9CRftADHv UGVXglHFAYqsl3zPOMisqO43D8FNALh1e/+ekPFQgbX7vPvwXDuVJZlsNw8Eq82GNtso bBB3keybHRFJ4+BD7V2aFiVb7UExoL6B+HiuTx5urj4a4jJAjG6HgP5URTw81fuaxADB IDag== X-Gm-Message-State: AOAM533+Prp+g2dtKy2p+WYQAJnGliwz9Iz0xu5n3xWbBN1xXeuGsTBD THbNsZhyng7RkhDPGWcrVwKHi40nc53V5FA7vDfFEm1P4C6gqjWuBYz71sLjKrm2ozUGrpTa7HR j9/Y1kvAx6guxxmhcGeZRLkzE X-Received: by 2002:adf:f643:: with SMTP id x3mr1943816wrp.180.1604657844087; 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: linux-kernel@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