Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2259873pxa; Mon, 17 Aug 2020 05:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaMNiDSCCQKo3RF6s3quNtMbZDfFFESgbsWxNsK2ZdbPQtYdEpebMzZ0DLqhzKxlNKgD3o X-Received: by 2002:a17:906:4d4f:: with SMTP id b15mr14686102ejv.534.1597667354266; Mon, 17 Aug 2020 05:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597667354; cv=none; d=google.com; s=arc-20160816; b=RRLmtghwiu52xKpnuAokJ5PtAi0zE/EkLFYugP01yb3iIPU6WaXKQ28zvllVTIAe/7 fnZN2yBzxrCG5heweDX1llx/ICqxp/8uk4XArvsfIokf1sQTPq0pxndO5l98r/C82bwL u3yGLxOxeBUfG0aDVhdCiXf0VODI9qWVpi/IC3S7SmS9y6A1hWjZtj1rNF5St0nM+T5W z7vDF4+/sZVXcS0AuPpafv3ST/55Qmx/k8YpTRrjU8oibzegIvvU7NNKe6p19c76aIOo VtLH4E/9pi9KREfjqphT0khjC1cVj/kmou12j5eIr3p/HDoBkVVcpjh39tdNzjfYAE8W AWvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=olp/v+qL630PUyT9g0PVkuhMlD6hA5/GGZ4L3t5t2cc=; b=at5gCZ4Y3G0s7KqOh/xFqr1f6jpdi+g5b123LeZMnnBoqkbByKaCw2NkJqvvR3kCpU CxMRJ7wMX6ske/oynIHJSvZ1/AJGbt4BFeRX9ZTJxOsPcjm2sEkUqtFHgYlpmIrZRChV mIJT1EJpIzned4Ct+zk24A4uiUrktw5Q6gFd27n+Y591fex7X+y/QJB46afNPQF9ACb1 GKfsgX0IThK6x17diY9tg5nz3D+2ui7G5vWUaiI4Vrov1oce/qTAn1L62U5hT1MuUtxL /MaYS1Vfjhl1MGCoaa3qHq0kixg0a1bLVOzfH4s/efzbtFc8D6LKvA4GfF8LHFf+auyB K7kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="h9GmAFF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si12854160edd.284.2020.08.17.05.28.51; Mon, 17 Aug 2020 05:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="h9GmAFF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728351AbgHQMZR (ORCPT + 99 others); Mon, 17 Aug 2020 08:25:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:44010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728317AbgHQMZI (ORCPT ); Mon, 17 Aug 2020 08:25:08 -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 99FFA20658; Mon, 17 Aug 2020 12:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597667107; bh=RCadk8ibATBlC4OXsKfPUxVYLbnc1pQ2OO78rBZG6yc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h9GmAFF/1R9Kaz+2nZ1gJUEdSkuolk7DrWiYGIpCxI2BkfTQ3AZlmTOWwUPSjSmQ3 FL5bikAbznQlWFNqieMVDUj5Y54rBaOuCeSvavd2eS5oepKBLM9TD6qmCeReqgmA+d 3H9UVjKoWqs6x1dNCWP7nfXphqkIY/UpohdzoDGY= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k7eCI-003YxY-1H; Mon, 17 Aug 2020 13:25:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 17 Aug 2020 13:25:05 +0100 From: Marc Zyngier To: yezengruan Cc: Sergey Senozhatsky , will@kernel.org, joelaf@google.com, linux-kernel@vger.kernel.org, suleiman@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, "Wanghaibin (D)" Subject: Re: [RFC][PATCH 0/4] arm64:kvm: teach guest sched that VCPUs can be preempted In-Reply-To: References: <20200721041742.197354-1-sergey.senozhatsky@gmail.com> <20200817020310.GA1210848@jagdpanzerIV.localdomain> User-Agent: Roundcube Webmail/1.4.7 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: yezengruan@huawei.com, sergey.senozhatsky@gmail.com, will@kernel.org, joelaf@google.com, linux-kernel@vger.kernel.org, suleiman@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-17 13:03, yezengruan wrote: > On 2020/8/17 10:03, Sergey Senozhatsky wrote: >> On (20/07/21 13:17), Sergey Senozhatsky wrote: >>> Hello, >>> >>> RFC >>> >>> We noticed that in a number of cases when we wake_up_process() >>> on arm64 guest we end up enqueuing that task on a preempted VCPU. The >>> culprit >>> appears to be the fact that arm64 guests are not aware of VCPU >>> preemption >>> as such, so when sched picks up an idle VCPU it always assumes that >>> VCPU >>> is available: >>> >>> wake_up_process() >>> try_to_wake_up() >>> select_task_rq_fair() >>> available_idle_cpu() >>> vcpu_is_preempted() // return false; >>> >>> Which is, obviously, not the case. >>> >>> This RFC patch set adds a simple vcpu_is_preempted() implementation >>> so >>> that scheduler can make better decisions when it search for the idle >>> (v)CPU. >> Hi, >> >> A gentle ping. >> >> -ss >> _______________________________________________ >> kvmarm mailing list >> kvmarm@lists.cs.columbia.edu >> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm >> . > > Hi Sergey, > > I have a set of patches similar to yours. > > https://lore.kernel.org/lkml/20191226135833.1052-1-yezengruan@huawei.com/ It really isn't the same thing at all. You are exposing PV spinlocks, while Sergey exposes preemption to vcpus. The former is a massive, and probably unnecessary superset of the later, which only impacts the scheduler (it doesn't change the way locks are implemented). You really shouldn't conflate the two (which you have done in your series). M. -- Jazz is not dead. It just smells funny...