Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4994057ima; Tue, 5 Feb 2019 04:53:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYodD8Pr2TnxHWhkb2FFaW1b46Zhjq6lEYiEJM6e/z7l4N5urGexrFZMOFHVIPlM5YVaCe8 X-Received: by 2002:a62:442:: with SMTP id 63mr4772079pfe.156.1549371207246; Tue, 05 Feb 2019 04:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549371207; cv=none; d=google.com; s=arc-20160816; b=B7nVhWkFLLmB1GgFVOErTpFpcHVAbMBbrjXC8zUAvbL3dIAmiXT3Z+P7QMfIhLaDoI SjXF4eevT3gzUOr78/uTu//6DlML2dgg+itJAFEu6jY/YJB0lEC8Ft3xWHr8FhBOlC8x N6D9YKLVVKAu+GB496IEO5pva7FIfhXTnsoZ7Rpk/qXwBplSCw8Vl2zOgp3AB1HEPFv8 daNH7GUBXFibBpoLAffUTbyqBTlkegv3fppzihOqcWqskmJlHTyurUt8fdu2RIJHEqA0 WV4HVKSW36W29RIm5A6UVYzWX+pkDL2AOvWjRXDQCN7r4d0hBnJQ9LTazx295CWipcSc 2nwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :organization:from:references:cc:to:subject:reply-to; bh=MGPwAhsWyr2DhcKEOhWTYfvibbNDKpacuigpYuT2cdg=; b=ja2FlZFJODci5Ep1+lhZH/IZ1XMpLONufFOqp3Wntbv2wtyEY3rEOs8k+De28QdY+Q ingwNryCEs++PeDPL2eXE95TWoIdEGpqapluHI3lZ44trMcTsgJ4MJ9J5+nn8vLlLZ+V A739cQrlJCdGQy2B8wg/oANDXTq9Wp1QjT8BlAeZpu/euKtkyMRm8hhwBKlTVk6580QA a/NkWOu3M7nEU6Ksxh4Sd/Mh75FMUCaoLQKFsj5JpdlUrVkTFl98OnLIDuQSmPJtTtta 6qQzx+3ywEEAOE1qNUn5sEj2T0pB6bOnwteU+SHEFDSp0D/J+3E83WnlRZLjXlix8i7T FrGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g69si3201621pfg.225.2019.02.05.04.53.10; Tue, 05 Feb 2019 04:53:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbfBEMw0 (ORCPT + 99 others); Tue, 5 Feb 2019 07:52:26 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60824 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727097AbfBEMw0 (ORCPT ); Tue, 5 Feb 2019 07:52:26 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x15CjUSX084992 for ; Tue, 5 Feb 2019 07:52:24 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qfapsrg8f-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 05 Feb 2019 07:52:24 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Feb 2019 12:52:22 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 5 Feb 2019 12:52:20 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x15CqIis7537012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 Feb 2019 12:52:18 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38AD9AE061; Tue, 5 Feb 2019 12:52:18 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1AEBAE053; Tue, 5 Feb 2019 12:52:17 +0000 (GMT) Received: from [9.152.224.122] (unknown [9.152.224.122]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Feb 2019 12:52:17 +0000 (GMT) Reply-To: mimu@linux.ibm.com Subject: Re: [PATCH v7 13/15] KVM: s390: add gib_alert_irq_handler() To: pmorel@linux.ibm.com, KVM Mailing List Cc: Linux-S390 Mailing List , linux-kernel@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Halil Pasic References: <20190131085247.13826-1-mimu@linux.ibm.com> <20190131085247.13826-14-mimu@linux.ibm.com> <50f05038-f414-50f5-dbe7-e2bcca0b8433@linux.ibm.com> From: Michael Mueller Organization: IBM Date: Tue, 5 Feb 2019 13:52:17 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <50f05038-f414-50f5-dbe7-e2bcca0b8433@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19020512-0008-0000-0000-000002BC4C48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19020512-0009-0000-0000-000022284E57 Message-Id: <3599eeec-eec1-6326-ba34-5e0f64c45934@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-05_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902050101 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.02.19 12:38, Pierre Morel wrote: > On 31/01/2019 09:52, Michael Mueller wrote: >> The patch implements a handler for GIB alert interruptions >> on the host. Its task is to alert guests that interrupts are >> pending for them. >> >> A GIB alert interrupt statistic counter is added as well: >> >> $ cat /proc/interrupts >>            CPU0       CPU1 >>    ... >>    GAL:      23         37   [I/O] GIB Alert >>    ... >> >> Signed-off-by: Michael Mueller >> Acked-by: Halil Pasic >> --- > > The only thing that bother me is the short timer's expiration value. > But it is optimization and it is working for me so. > > Reviewed-by: Pierre Morel Thanks, Pierre. For completion I want to add that one sees roughly 1 timer restart per vcpu that gets kicked in my test scenario with 12 AP IRQ guests. The guests have 4 x 1, 4 x 4 and 4 x 8 vcpus backed by 8 IFLs. Furthermore the 12 guests share 4 CEX5C cards each configured with 3 AP queues. On the guest runs a single threaded AP driver that performs RSA decryptions with CRT private keys with a short 512 bit length to get many ops/s. That run has no additional cpu load. ./run_ap_load.sh 12 [1] 12:53:09 [SUCCESS] root@ap04 [2] 12:53:09 [SUCCESS] root@ap08 [3] 12:53:10 [SUCCESS] root@ap02 [4] 12:53:10 [SUCCESS] root@ap03 [5] 12:53:10 [SUCCESS] root@ap01 [6] 12:53:10 [SUCCESS] root@ap12 [7] 12:53:10 [SUCCESS] root@ap06 [8] 12:53:10 [SUCCESS] root@ap05 [9] 12:53:10 [SUCCESS] root@ap07 [10] 12:53:10 [SUCCESS] root@ap10 [11] 12:53:10 [SUCCESS] root@ap09 [12] 12:53:10 [SUCCESS] root@ap11 KVM guests: 12 ica_perf threads: 1 stress cpu threads: 0 stress io threads: 0 expected AP IRQs: 600048 observed AP IRQs: 600048 observed VAI IRQs: 1311 observed GAL IRQs: 575505 __gal_stats_ipm_dirty = 613762 __gal_stats_timer_active = 0 __gal_stats_timer_no_restart = 600048 __gal_stats_timer_not_active = 600048 __gal_stats_timer_restart = 613762 __gal_stats_vcpus_kicked = 599688 The counters are placed as follows: @@ -2998,6 +2999,7 @@ static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask) if (test_and_set_bit(vcpu_id, gi->kicked_mask)) return; kvm_s390_vcpu_wakeup(vcpu); + __gal_stats_inc(kvm, vcpus_kicked); return; } } @@ -3013,11 +3015,14 @@ static enum hrtimer_restart gisa_vcpu_kicker(struct hrtimer *timer) pending_mask = gisa_get_ipm_or_restore_iam(gi); if (pending_mask) { + __gal_stats_inc(kvm, ipm_dirty); __airqs_kick_single_vcpu(kvm, pending_mask); hrtimer_forward_now(timer, ns_to_ktime(gi->expires)); + __gal_stats_inc(kvm, timer_restart); return HRTIMER_RESTART; }; + __gal_stats_inc(kvm, timer_no_restart); return HRTIMER_NORESTART; } Cheers, Michael