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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 B732CC07E99 for ; Mon, 12 Jul 2021 15:47:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 977D26120D for ; Mon, 12 Jul 2021 15:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235545AbhGLPty (ORCPT ); Mon, 12 Jul 2021 11:49:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:47746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbhGLPtx (ORCPT ); Mon, 12 Jul 2021 11:49:53 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41C3C61209; Mon, 12 Jul 2021 15:47:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m2y99-00CrXf-JR; Mon, 12 Jul 2021 16:47:03 +0100 Date: Mon, 12 Jul 2021 16:47:03 +0100 Message-ID: <875yxf356w.wl-maz@kernel.org> From: Marc Zyngier To: Sergey Senozhatsky Cc: Will Deacon , Suleiman Souhlal , Joel Fernandes , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCHv2 3/4] arm64: do not use dummy vcpu_is_preempted() In-Reply-To: <20210709043713.887098-4-senozhatsky@chromium.org> References: <20210709043713.887098-1-senozhatsky@chromium.org> <20210709043713.887098-4-senozhatsky@chromium.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: senozhatsky@chromium.org, will@kernel.org, suleiman@google.com, joelaf@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 09 Jul 2021 05:37:12 +0100, Sergey Senozhatsky wrote: > > vcpu_is_preempted() now can represent the actual state of > the VCPU, so the scheduler can make better decisions when > it picks the idle CPU to enqueue a task on. > > Signed-off-by: Sergey Senozhatsky > --- > arch/arm64/include/asm/spinlock.h | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h > index 0525c0b089ed..1d579497e1b8 100644 > --- a/arch/arm64/include/asm/spinlock.h > +++ b/arch/arm64/include/asm/spinlock.h > @@ -7,21 +7,23 @@ > > #include > #include > +#include > > /* See include/linux/spinlock.h */ > #define smp_mb__after_spinlock() smp_mb() > > -/* > - * Changing this will break osq_lock() thanks to the call inside > - * smp_cond_load_relaxed(). > - * > - * See: > - * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net > - */ Why are you deleting this? Please explain your reasoning in the commit message. It seems to me that it still makes complete sense when CONFIG_PARAVIRT is not defined. > #define vcpu_is_preempted vcpu_is_preempted > -static inline bool vcpu_is_preempted(int cpu) > + > +#ifdef CONFIG_PARAVIRT > +static inline bool vcpu_is_preempted(unsigned int cpu) > +{ > + return paravirt_vcpu_is_preempted(cpu); > +} > +#else > +static inline bool vcpu_is_preempted(unsigned int cpu) > { > return false; > } > +#endif /* CONFIG_PARAVIRT */ > > #endif /* __ASM_SPINLOCK_H */ Thanks, M. -- Without deviation from the norm, progress is not possible. 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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 76838C07E99 for ; Mon, 12 Jul 2021 15:47:11 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id E199161209 for ; Mon, 12 Jul 2021 15:47:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E199161209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 82796405A6; Mon, 12 Jul 2021 11:47:10 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fefxU13F5tqm; Mon, 12 Jul 2021 11:47:08 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8ABD84086C; Mon, 12 Jul 2021 11:47:08 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 43E8940294 for ; Mon, 12 Jul 2021 11:47:07 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g1QLQtQsue3E for ; Mon, 12 Jul 2021 11:47:06 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 3514140569 for ; Mon, 12 Jul 2021 11:47:06 -0400 (EDT) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41C3C61209; Mon, 12 Jul 2021 15:47:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m2y99-00CrXf-JR; Mon, 12 Jul 2021 16:47:03 +0100 Date: Mon, 12 Jul 2021 16:47:03 +0100 Message-ID: <875yxf356w.wl-maz@kernel.org> From: Marc Zyngier To: Sergey Senozhatsky Subject: Re: [PATCHv2 3/4] arm64: do not use dummy vcpu_is_preempted() In-Reply-To: <20210709043713.887098-4-senozhatsky@chromium.org> References: <20210709043713.887098-1-senozhatsky@chromium.org> <20210709043713.887098-4-senozhatsky@chromium.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: senozhatsky@chromium.org, will@kernel.org, suleiman@google.com, joelaf@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: Joel Fernandes , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Suleiman Souhlal , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, 09 Jul 2021 05:37:12 +0100, Sergey Senozhatsky wrote: > > vcpu_is_preempted() now can represent the actual state of > the VCPU, so the scheduler can make better decisions when > it picks the idle CPU to enqueue a task on. > > Signed-off-by: Sergey Senozhatsky > --- > arch/arm64/include/asm/spinlock.h | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h > index 0525c0b089ed..1d579497e1b8 100644 > --- a/arch/arm64/include/asm/spinlock.h > +++ b/arch/arm64/include/asm/spinlock.h > @@ -7,21 +7,23 @@ > > #include > #include > +#include > > /* See include/linux/spinlock.h */ > #define smp_mb__after_spinlock() smp_mb() > > -/* > - * Changing this will break osq_lock() thanks to the call inside > - * smp_cond_load_relaxed(). > - * > - * See: > - * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net > - */ Why are you deleting this? Please explain your reasoning in the commit message. It seems to me that it still makes complete sense when CONFIG_PARAVIRT is not defined. > #define vcpu_is_preempted vcpu_is_preempted > -static inline bool vcpu_is_preempted(int cpu) > + > +#ifdef CONFIG_PARAVIRT > +static inline bool vcpu_is_preempted(unsigned int cpu) > +{ > + return paravirt_vcpu_is_preempted(cpu); > +} > +#else > +static inline bool vcpu_is_preempted(unsigned int cpu) > { > return false; > } > +#endif /* CONFIG_PARAVIRT */ > > #endif /* __ASM_SPINLOCK_H */ Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 636B0C07E99 for ; Mon, 12 Jul 2021 15:48:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 267F861209 for ; Mon, 12 Jul 2021 15:48:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 267F861209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R+UN6hagaUdoVypuCb6uV02z+9H7HviERzmZHutJ7JQ=; b=cXQhUGvGMVgBV/ F9OGMG3C2SeK9iL+PpkXebekjoJNK60kDp6A//3W0S+6jwPQ1l+d9NyMncZnXV2O7itTifyqlmFki wBeMdEFnnX5dQlV2Z00RlyuKfDU3MjO37oKkZsK+FTumm2OeX9cr6UhSL06kTynC1EMH6EvaWBPqW PTpsw25HCCbx0VvosbmyqbyUcWrggCtB8+GHQ6L221xW9Tdux7vp6TsKaq7waanxh7Wfuv1EdNiSz xAJqzdb9rwvZuW0sTP77MpelBEYQaHCWuciPHerWhZflnUWzyIgcMA6/gHVuiEiH+9e+D1/SR3jd1 wlAABukML7p1KXUo1C0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2y9E-007nIp-Q9; Mon, 12 Jul 2021 15:47:08 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2y9B-007nIF-KC for linux-arm-kernel@lists.infradead.org; Mon, 12 Jul 2021 15:47:07 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41C3C61209; Mon, 12 Jul 2021 15:47:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m2y99-00CrXf-JR; Mon, 12 Jul 2021 16:47:03 +0100 Date: Mon, 12 Jul 2021 16:47:03 +0100 Message-ID: <875yxf356w.wl-maz@kernel.org> From: Marc Zyngier To: Sergey Senozhatsky Cc: Will Deacon , Suleiman Souhlal , Joel Fernandes , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCHv2 3/4] arm64: do not use dummy vcpu_is_preempted() In-Reply-To: <20210709043713.887098-4-senozhatsky@chromium.org> References: <20210709043713.887098-1-senozhatsky@chromium.org> <20210709043713.887098-4-senozhatsky@chromium.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: senozhatsky@chromium.org, will@kernel.org, suleiman@google.com, joelaf@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_084705_726597_34B6EB70 X-CRM114-Status: GOOD ( 23.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 09 Jul 2021 05:37:12 +0100, Sergey Senozhatsky wrote: > > vcpu_is_preempted() now can represent the actual state of > the VCPU, so the scheduler can make better decisions when > it picks the idle CPU to enqueue a task on. > > Signed-off-by: Sergey Senozhatsky > --- > arch/arm64/include/asm/spinlock.h | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h > index 0525c0b089ed..1d579497e1b8 100644 > --- a/arch/arm64/include/asm/spinlock.h > +++ b/arch/arm64/include/asm/spinlock.h > @@ -7,21 +7,23 @@ > > #include > #include > +#include > > /* See include/linux/spinlock.h */ > #define smp_mb__after_spinlock() smp_mb() > > -/* > - * Changing this will break osq_lock() thanks to the call inside > - * smp_cond_load_relaxed(). > - * > - * See: > - * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net > - */ Why are you deleting this? Please explain your reasoning in the commit message. It seems to me that it still makes complete sense when CONFIG_PARAVIRT is not defined. > #define vcpu_is_preempted vcpu_is_preempted > -static inline bool vcpu_is_preempted(int cpu) > + > +#ifdef CONFIG_PARAVIRT > +static inline bool vcpu_is_preempted(unsigned int cpu) > +{ > + return paravirt_vcpu_is_preempted(cpu); > +} > +#else > +static inline bool vcpu_is_preempted(unsigned int cpu) > { > return false; > } > +#endif /* CONFIG_PARAVIRT */ > > #endif /* __ASM_SPINLOCK_H */ Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel