Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp602506ybb; Fri, 3 Apr 2020 08:31:57 -0700 (PDT) X-Google-Smtp-Source: APiQypJJ/UyBVO3qrq8VR4ZBIIwJlWgTJzNRr1QUt/NP2pLYc6DYiIC6RGVyrfXjTFp0pB3NDb4x X-Received: by 2002:a05:6830:10c2:: with SMTP id z2mr6651438oto.234.1585927917557; Fri, 03 Apr 2020 08:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585927917; cv=none; d=google.com; s=arc-20160816; b=sIT1/QRdYAWZ/ox+t6Qr4zBmXpXeNs6rgskUG4+/sXS0hKVy4tcZXWVdqjhDKrFp+E KK5wPtVxiQ1t6iyTCJ6zyCZZ8DgJjbK/703tWpdxF5v8m6hAM9Rn1Fk+ftu5HK+a5nPk Lnsm33p9RZP5nWBmuL8RbOYbhkTU5pe7HzITJosPaIELz3TU8gITLPX8XRczA0OMoFbV Zr0Zwk0ld1Tb6X8FD8pjm3PNf56UIse+QqQGwdfv2qqIPrPRt5lZTvgpKPNipRSQC8jk K3FPT+pTTTz3eA6U6OBYlmhI+w6zx1JP/oVcQv7l17vBIP2Hcgzw7pRJTGS8VlfK1CE+ SFCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5Mna+DLBALS7Nv4a/6CqV2AmkqQOOKpm1xodEo/O7Gc=; b=eWIUgoErY2u4TLS2ORf0vR+dNsgKzy77qZLnhpiracCNxB2O+l/2h+UC4IrYdAxrUb jZEOFoSjdtkBTkFq1Jp6r+GmQb3++G9n01T39tpQDWMD1wDtEVCcnFBa1oIhQUX7k7V5 XpZxxsj4EzAWGnt+BRslouwMjymRybbSxcoITdvY6wLuVJCCwXWUdMDeqxhoO+JqmXAN e8BLA4GAEVvEOUa+OGSBIgl4JHNWTO6LJvdCmkLZ56vgdLmVFlkbWrqAGNwRtzU48plj suixjNMTMAadwac+jOKGFN1PaDNXorOJFWKzzK2xfTMKeguGA/i2dTgJM5MGvj7HgJki fryQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RePrLw3o; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 79si4005936oty.232.2020.04.03.08.31.44; Fri, 03 Apr 2020 08:31:57 -0700 (PDT) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RePrLw3o; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404312AbgDCPbO (ORCPT + 99 others); Fri, 3 Apr 2020 11:31:14 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43607 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404310AbgDCPbM (ORCPT ); Fri, 3 Apr 2020 11:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585927871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Mna+DLBALS7Nv4a/6CqV2AmkqQOOKpm1xodEo/O7Gc=; b=RePrLw3olQO9DAYOkzn0anO7bZFu9GSXvOSxJeqocnHGiGZ8xzt1rQqN9F+LmE+9UGr+MT Z4QXKkA2Fya99I8fvEeWtQpNcR/IMHVOwWU6WrsuP+7GI9hGjBP1Q78lmIc0ebyrRH9/i/ MBou1TA/BzSuR3cOUWERb2umMCo8I4o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-3_BoqKm6MkSVwTpjGmDjAA-1; Fri, 03 Apr 2020 11:31:08 -0400 X-MC-Unique: 3_BoqKm6MkSVwTpjGmDjAA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8BBD2800D50; Fri, 3 Apr 2020 15:31:06 +0000 (UTC) Received: from t480s.redhat.com (ovpn-112-213.ams2.redhat.com [10.36.112.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D8D626DD1; Fri, 3 Apr 2020 15:31:04 +0000 (UTC) From: David Hildenbrand To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Vasily Gorbik , Heiko Carstens , Cornelia Huck , Janosch Frank , Christian Borntraeger , David Hildenbrand Subject: [PATCH v2 4/5] KVM: s390: vsie: Move conditional reschedule Date: Fri, 3 Apr 2020 17:30:49 +0200 Message-Id: <20200403153050.20569-5-david@redhat.com> In-Reply-To: <20200403153050.20569-1-david@redhat.com> References: <20200403153050.20569-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's move it to the outer loop, in case we ever run again into long loops, trying to map the prefix. While at it, convert it to cond_resched(= ). Signed-off-by: David Hildenbrand --- arch/s390/kvm/vsie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 4f6c22d72072..ef05b4e167fb 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -1000,8 +1000,6 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struc= t vsie_page *vsie_page) =20 handle_last_fault(vcpu, vsie_page); =20 - if (need_resched()) - schedule(); if (test_cpu_flag(CIF_MCCK_PENDING)) s390_handle_mcck(); =20 @@ -1185,6 +1183,7 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct v= sie_page *vsie_page) kvm_s390_vcpu_has_irq(vcpu, 0) || kvm_s390_vcpu_sie_inhibited(vcpu)) break; + cond_resched(); } =20 if (rc =3D=3D -EFAULT) { --=20 2.25.1