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=-3.8 required=3.0 tests=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 7BA7AC4CEC9 for ; Tue, 17 Sep 2019 14:33:22 +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 5898C214AF for ; Tue, 17 Sep 2019 14:33:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5898C214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iAEXW-0002pR-1d; Tue, 17 Sep 2019 14:33:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iAEXV-0002pD-5e for xen-devel@lists.xenproject.org; Tue, 17 Sep 2019 14:33:09 +0000 X-Inumbo-ID: 10d0651a-d958-11e9-b299-bc764e2007e4 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 10d0651a-d958-11e9-b299-bc764e2007e4; Tue, 17 Sep 2019 14:33:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 147F9B667; Tue, 17 Sep 2019 14:33:07 +0000 (UTC) Message-ID: <04ddefb4e66b349135631bd6dd63f3091d0707ec.camel@suse.com> From: Dario Faggioli To: Juergen Gross , xen-devel@lists.xenproject.org Date: Tue, 17 Sep 2019 16:33:05 +0200 In-Reply-To: <20190914064217.4877-1-jgross@suse.com> References: <20190914064217.4877-1-jgross@suse.com> Organization: SUSE User-Agent: Evolution 3.32.4 MIME-Version: 1.0 Subject: Re: [Xen-devel] [PATCH v2] xen/sched: rework and rename vcpu_force_reschedule() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Roger Pau =?ISO-8859-1?Q?Monn=E9?= Content-Type: multipart/mixed; boundary="===============8927049015020845364==" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" --===============8927049015020845364== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-GffDWQIRVuhBqrMKHErn" --=-GffDWQIRVuhBqrMKHErn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2019-09-14 at 08:42 +0200, Juergen Gross wrote: > vcpu_force_reschedule() is only used for modifying the periodic timer > of a vcpu. Forcing a vcpu to give up the physical cpu for that > purpose > is kind of brutal. >=20 > So instead of doing the reschedule dance just operate on the timer > directly. By protecting periodic timer modifications against > concurrent > timer activation via a per-vcpu lock it is even no longer required to > bother the target vcpu at all for updating its timer. >=20 > Rename the function to vcpu_set_periodic_timer() as this now reflects > the functionality. >=20 Personally, I'm rather happy to see the code which was doing that very weird "let's go through rescheduling" dance going away. I, FWIW, never understood why periodic timer handling was implemented that way (and looking back at relevant changelogs does not help). The code, as it results after applying this patch, is a lot better, and easier to understand. Performance and scalability wise, I don't have benchmarks for this specific patch (but the ones I did included it, as it back then was part of the core-scheduling series), but I agree with Juergen. I.e., I think the patch is either neutral or, if it does something, it improves things. Furthermore, periodic timer is *not* used any longer (and since quite some time/kernel versions). Basically, all we do with the periodic timer is to disable it during boot. At least for Linux, but I think this is the case for FreeBSD too. So, even if the patch would have a negative impact (which again I don't think it's the case), we probably won't see them. On this grounds (and, of course, on the one that I've looked at the code, and think it's correct), for the scheduling part: > Signed-off-by: Juergen Gross > Reviewed-by: Dario Faggioli Then, if some words about the outcome of the discussion in this thread, e.g., a mention to the fact that the old code wasn't really lockless, and that the new code is a lot more straightforward, it'd be even better. But my Rev-by stands, with or without this. Regards --=20 Dario Faggioli, Ph.D http://about.me/dario.faggioli Virtualization Software Engineer SUSE Labs, SUSE https://www.suse.com/ ------------------------------------------------------------------- <> (Raistlin Majere) --=-GffDWQIRVuhBqrMKHErn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEES5ssOj3Vhr0WPnOLFkJ4iaW4c+4FAl2A7qEACgkQFkJ4iaW4 c+5DmBAArie4EepGP79XEmTUDnx+oPXK993OYPtFS6R8C4Oa+gfF0g1L0AUtgJqK 3xDxtJDSDKigjsiIjeVoDuuqC0zU7kU5w0x4l4cH356WzleKy/IlzuO8nurPK4AL t6oumyCLZniMG6ik40Jad2RV9sSSxkEfqYuKPjEfqmI7f90q6hctguyi/f+/nEpA 8/XZdqUcvp6Q+9VHEHDYfk0wYErYJErwNwGhtgZRMtrDshIbDuz/eyjv2eQTiNln AQ4TrvOglGmr5z7h+2hA8r+BYCdwr4yCrssv8QTFl+evjnGRoJACX0FYYEyedcFA bEDW/xDZ+Hg33Nfnk8NQS4LvtKDbwKLi1RrC3xEY788gDj4RFTjbj6uxdSPDH65O WJMJi68QzOsugPCMiFSqYO3/m/EdtkWzUv37MgxLjY+1JRT3dUtLWOO05Th4HCGq c3zHuThEDorbO74d/fIadia4hk9136+lP6e7G+wDGVEBvB9Ilz3s7ATH9fpuIiSZ HgFFBz6fFg/d5UHPDq01EY2l2BU/JqYtCbv5u5OFjKZjh9Co4fAUr7rDLVblEweF 4womIKUNp6UgUeCZ/Rs9HmmXcmSWILWCR5edrNPxEVgSmwnzqyJVVbg0gG18RHI1 iXXJP1q3hI16HN1xpV67NW16Und0USUwO02LrnXLP9UlLHkNz2s= =r+oH -----END PGP SIGNATURE----- --=-GffDWQIRVuhBqrMKHErn-- --===============8927049015020845364== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --===============8927049015020845364==--