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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 C2DBCC2D0A8 for ; Wed, 30 Sep 2020 07:35:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A7D52075F for ; Wed, 30 Sep 2020 07:35:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CxKiaB42" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A7D52075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.455.1417 (Exim 4.92) (envelope-from ) id 1kNWdp-0005xz-CK; Wed, 30 Sep 2020 07:35:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 455.1417; Wed, 30 Sep 2020 07:35:09 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNWdp-0005xs-8p; Wed, 30 Sep 2020 07:35:09 +0000 Received: by outflank-mailman (input) for mailman id 455; Wed, 30 Sep 2020 07:35:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNWdo-0005xn-Lb for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 07:35:08 +0000 Received: from mail-wm1-x32c.google.com (unknown [2a00:1450:4864:20::32c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1a6a4086-27fc-4106-9d29-398e1407fa3f; Wed, 30 Sep 2020 07:35:07 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id k18so586233wmj.5 for ; Wed, 30 Sep 2020 00:35:07 -0700 (PDT) Received: from CBGR90WXYV0 (54-240-197-232.amazon.com. [54.240.197.232]) by smtp.gmail.com with ESMTPSA id f16sm1347270wrp.47.2020.09.30.00.35.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2020 00:35:06 -0700 (PDT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNWdo-0005xn-Lb for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 07:35:08 +0000 X-Inumbo-ID: 1a6a4086-27fc-4106-9d29-398e1407fa3f Received: from mail-wm1-x32c.google.com (unknown [2a00:1450:4864:20::32c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1a6a4086-27fc-4106-9d29-398e1407fa3f; Wed, 30 Sep 2020 07:35:07 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id k18so586233wmj.5 for ; Wed, 30 Sep 2020 00:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=3ywFpwHJMPTKBX9+Vp1+Xj+rLy00yMFcoHjmCv7p+KY=; b=CxKiaB42DQ0L26qtwa7PWxKfoxYBnvS2MxXMRTP7TflQY/CJ8D7lEJ9fwzsurgUG0P CDgPqAqKPwthQQrg4wT1kiSy448LUQdNADbFR/+xIH0S0VvufY4QBHmXq7fWMtjsUKfa e/oXsySRSbWJbTo95h+A3luOYQhRYy6QJa08DN7LnMWYGqOYtt0BR2JMRYN8WAd896Wj 5oxzf1yKmIWbSVIKTmwo0c+W7KvL2DJgT2hf6N1cN8f/QmPTi/75V+RGX1tPPv2OtRCH 3JF3ZyV0dmnkP9e8DuXb5STsFjWd+SIaZhV0/yjsYRIK4haJjBbNRmLvhS7mBMyA5bXI QvOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :content-language:thread-index; bh=3ywFpwHJMPTKBX9+Vp1+Xj+rLy00yMFcoHjmCv7p+KY=; b=nhmHawUYiyfeKgTJUfUdoPsxkJRtkH9TdNt+LTEDRmcTEc6+xMDfQcH4DBLoGSu3VJ eGn2kGx4PeS7+ez8Nv633isjCysR+6gdNpqo5+I93qy7fKh3UJAmmomZqZCV0EpBlOBa DpMkrecjpMpWNYn88F/MOOcgqEdM/TSjjZS94G+fVSVogESK86z1p8Av2zmfk2hsM89e D/e4s9VXrCbloFKgcGbDgbr/rALI5v5ZfZpFmO2IvnJzJNxZhms3mgt5AkwuXKwSDSzC CEXo7d461dKGW10FdkeOlJnI0Qa/1j045rf8yBTMFcbY7+77WEM/BU9NqWOnvtGSfgw5 wD1Q== X-Gm-Message-State: AOAM531yCXltHC7ADOsNCF5pbftK3AuByY/amuNl84OYu6gbDDxvPBSY Q/Mn0CqGJjUhjJvKvDGzKsc= X-Google-Smtp-Source: ABdhPJwczDwlpMMdkZgCacEaxWYXFvEDdD8Ipe/QVJq5kYCeKCfMmAxLOIXxizlHRBVCu7A1y+ZXOg== X-Received: by 2002:a1c:2cc4:: with SMTP id s187mr1488091wms.30.1601451307119; Wed, 30 Sep 2020 00:35:07 -0700 (PDT) Received: from CBGR90WXYV0 (54-240-197-232.amazon.com. [54.240.197.232]) by smtp.gmail.com with ESMTPSA id f16sm1347270wrp.47.2020.09.30.00.35.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2020 00:35:06 -0700 (PDT) From: Paul Durrant X-Google-Original-From: "Paul Durrant" Reply-To: To: "'Jan Beulich'" , Cc: "'Andrew Cooper'" , "'George Dunlap'" , "'Ian Jackson'" , "'Julien Grall'" , "'Wei Liu'" , "'Stefano Stabellini'" References: <0d5ffc89-4b04-3e06-e950-f0cb171c7419@suse.com> In-Reply-To: Subject: RE: [PATCH 10/12] evtchn/fifo: use stable fields when recording "last queue" information Date: Wed, 30 Sep 2020 08:35:05 +0100 Message-ID: <004501d696fc$37c969c0$a75c3d40$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQHyn6bUUfstxLK2yDInWW9SM20ChgLG8CiyqTGQdtA= > -----Original Message----- > From: Xen-devel On Behalf Of Jan Beulich > Sent: 28 September 2020 12:02 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper ; George Dunlap ; Ian > Jackson ; Julien Grall ; Wei Liu ; Stefano Stabellini > > Subject: [PATCH 10/12] evtchn/fifo: use stable fields when recording "last queue" information > > Both evtchn->priority and evtchn->notify_vcpu_id could, prior to recent > locking adjustments, change behind the back of > evtchn_fifo_set_pending(). Neither the queue's priority nor the vCPU's > vcpu_id fields have similar properties, so they seem better suited for > the purpose. In particular they reflect the respective evtchn fields' > values at the time they were used to determine queue and vCPU. > > Signed-off-by: Jan Beulich > I think these changes make the code clearer anyway. Reviewed-by: Paul Durrant > --- a/xen/common/event_fifo.c > +++ b/xen/common/event_fifo.c > @@ -246,8 +246,8 @@ static void evtchn_fifo_set_pending(stru > /* Moved to a different queue? */ > if ( old_q != q ) > { > - evtchn->last_vcpu_id = evtchn->notify_vcpu_id; > - evtchn->last_priority = evtchn->priority; > + evtchn->last_vcpu_id = v->vcpu_id; > + evtchn->last_priority = q->priority; > > spin_unlock_irqrestore(&old_q->lock, flags); > spin_lock_irqsave(&q->lock, flags); >