Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1990081pxa; Sun, 16 Aug 2020 19:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUy9eneyLHXYABLy5zMYY94Ixm1HuwgN109RNVZx+rxqGN3XyXm6Pnrb4DYcHELvcJqpcA X-Received: by 2002:a50:ef0a:: with SMTP id m10mr13134011eds.226.1597629933864; Sun, 16 Aug 2020 19:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597629933; cv=none; d=google.com; s=arc-20160816; b=GMqpxZSniNrP+6pSx+V/SZ2qKDCrBRjkJEhmYy4AU6YxG1/bOiIJ+fn53NJr9K5P3C i3j4nBAY/bO61UgIMe9pRMSljnPy/U28T31h8VtivLu7MowWbWhuUj+j0yPjGns6d6uA uhVRverHrrvU2MxWTbVQdotah5p0OqLObmhftTeDefWLQJvnisUM3FjG12H95bZvhPs5 DXtJ5R1ifLz0OxeOgLvmMqDF6nwxrauPWcw/kr8O7ycL0yil7dei0fy1VgapqulX6DNq hGM9suf6tMGD0EhahVSw0ECpGaxaNg+1J/oylBQEHtYHI9Mu6fxb3JeCZ+qPitayB762 3IGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=g5HDuGeUVDk8sqM9/o9Q4NUmETeOwP25OuVRGMdbePY=; b=w5h+3ukIfLiqGlboykTNRcVpK09b1wpalXdmzIlbZzI2MGrtZ/mi5S0UvqrpsNNkxd FjfNciYFFwnPjhFjY1dsxKLEHWmgTkGCrhE37ZRNUXHvkVeq5b1uxyGtqVh8mW6Nzwnm GuAoO8fkrG4sc/CtnsCVo25pqgRW01h9m0gn3zTey4kotM4a3po/gA3c9zAx4Z6fAWQ4 NmKlZXZEC98X7F9YCSStT0K1DwcN0OZ7VcIRCdvT/ufK9QsGGTVxHfrW7ASw4wNElRAG bS8kDhMjNqrAIwkuT6YpziNTgbVd2pst8DNbWK7LzNUjH85pl3GF/+BpdWSWhP9Qh5Sh 4V9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UHlkQh/6"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si10035059eje.180.2020.08.16.19.04.57; Sun, 16 Aug 2020 19:05:33 -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=@gmail.com header.s=20161025 header.b="UHlkQh/6"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgHQCDO (ORCPT + 99 others); Sun, 16 Aug 2020 22:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbgHQCDM (ORCPT ); Sun, 16 Aug 2020 22:03:12 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7533C061786 for ; Sun, 16 Aug 2020 19:03:12 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id r11so7442066pfl.11 for ; Sun, 16 Aug 2020 19:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g5HDuGeUVDk8sqM9/o9Q4NUmETeOwP25OuVRGMdbePY=; b=UHlkQh/6diYYltxpDHOf9F6jhol14EbQYUrpGuhjvkcO8jon5uiJ4TImBdetaDSwv2 XEawf1DrPtHMEfmKHTXnLkZFvqmqbO8rYrd37X3aiOk8vBrEoWL+G94nVoT5aJsXmQsm Go9KlFt4aN3b9hWucnpcRpB/NQcLN+vX0Rd/Kk2MiJ036vl7dnnQ5XeO7DpTKnnqG2qU dsifEdi4HLaQk8lmm5b++5gcyTKSwaKiXkqPnyUKhJs4NEYLhAzQCN8n84QpQZDV3p/u 7wtsBbqByBqeEXfd32Q33LqFtpwduLcrA857QLGv4wcraYoxWiGFxmK/u0O2z5OTkvzn d95w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g5HDuGeUVDk8sqM9/o9Q4NUmETeOwP25OuVRGMdbePY=; b=Tu1+xEHICBolinz2+WAqApMUwGL4kW6XMxOVaWVTRrW8Mlyf/OmgphDWNDyHPgN+FC HPAolGLwX3qzaXPBK1g0qTQjweR/s0HinsNEaLsdI8aYOQJxNWR2eIuSoi+LQOzyvSrf ibNM29T9loAdzQxJDT3KvuZOQgtJuVbaZDs9ISOFUEh711PPkPYU81s6xlxOrkfC+fBO Azdjxo9GEad23Sfk7DeYk/BU4PptKSp0fki8ncR2KBIDrwW1Wzuo7265FdASnoxPVlPQ jqxVit9qspslGV7MixDm+iKuwkBN4xaq2SeRHAz9RHOS56tIEWZbPsz+F+rwG3FxgECT oW0w== X-Gm-Message-State: AOAM532w3U95Q3q839VjL9Senpwy1sfWeNqJAH85H36V7zBaqFdVJXM6 lRdoNS2KxjPiufR/uTxazCU= X-Received: by 2002:a62:2c0e:: with SMTP id s14mr9881030pfs.289.1597629791959; Sun, 16 Aug 2020 19:03:11 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id na16sm15433091pjb.30.2020.08.16.19.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2020 19:03:11 -0700 (PDT) Date: Mon, 17 Aug 2020 11:03:10 +0900 From: Sergey Senozhatsky To: Will Deacon , Marc Zyngier Cc: James Morse , Julien Thierry , Suzuki K Poulose , suleiman@google.com, joelaf@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCH 0/4] arm64:kvm: teach guest sched that VCPUs can be preempted Message-ID: <20200817020310.GA1210848@jagdpanzerIV.localdomain> References: <20200721041742.197354-1-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721041742.197354-1-sergey.senozhatsky@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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