Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp242326ybz; Thu, 23 Apr 2020 22:54:05 -0700 (PDT) X-Google-Smtp-Source: APiQypLz4xLYuCNj6hj/YtKdEtLiPRBbDENhA/ecPfWvwFSs9s19cZIr2T0WvNI+sGVnY6A4Eg9m X-Received: by 2002:a50:c004:: with SMTP id r4mr5401050edb.110.1587707645316; Thu, 23 Apr 2020 22:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587707645; cv=none; d=google.com; s=arc-20160816; b=W1Nuqd8WqdV5RxpoW149wEZZx/QccP7XjPlDYhXOHOVH6KojXWM+0ciO3EiYHZoDbb DCcFtRVY3dyVh7zxHX+jph3qzY403ejKqeAuANyTz4n3Hje6f54hKQPifi9MPBmp7jFj P5+aIzy8eIkV4FlbA1MGoZzedQYdum3UuJi19Ws+xIvjjtwJIAv8JlDdeEbuPV7ZBWhY DfmUo/PkT8rdi3xOr+imOo4/0y4jv2DbfPk5oU7EbQMQWaDhvfApGLQyQ7Yn0dwIDAzx bADahyAnAt5cztqZIrERqX34x1GoWiOjx/FYWMsHTmSzYjMZzLs8EL6uLMFFYVONFtlw sU7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=jDRP2saRwzJFaEu07luwfG7qcle7ta0L7IH4RBuCEvw=; b=raoYngXQ4HA1Z5tu0sVXqfpeGzBJ8fmAcsPjKtzg4QyvdFzkyDOTseFK40MbZzy/ls rXmDCCDZSB0pxlnyNgSYi3jeSyV5uwpkig7wJY6jV54ehq3TMSVZ5KHNhjqYNFiQVzT+ J9zlVj/extBKUEbr9xF7PyJxXkTvP4bF0RaRvrCGjDac2Azepp/RpVAw0zTykJ92IHBx KbjnyRvIpZbGWLzOkgBx+wHfezt9xHP6TLMaFrj54Qy8xagELKJvuGx0E3DjI2/MWsTA MvB9OyeZPuR42q6/gNr3dZ4AzZTTs9zQTPH/qmGDnfcJ0mpXH45isCL2iw+nJ3mLfdg5 30xw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si2363392edv.297.2020.04.23.22.53.41; Thu, 23 Apr 2020 22:54:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbgDXFwU (ORCPT + 99 others); Fri, 24 Apr 2020 01:52:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:36982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgDXFwT (ORCPT ); Fri, 24 Apr 2020 01:52:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 801EBAD71; Fri, 24 Apr 2020 05:52:16 +0000 (UTC) From: Davidlohr Bueso To: tglx@linutronix.de, pbonzini@redhat.com Cc: peterz@infradead.org, maz@kernel.org, bigeasy@linutronix.de, rostedt@goodmis.org, torvalds@linux-foundation.org, will@kernel.org, joel@joelfernandes.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dave@stgolabs.net Subject: [PATCH v4 0/5] kvm: Use rcuwait for vcpu blocking Date: Thu, 23 Apr 2020 22:48:32 -0700 Message-Id: <20200424054837.5138-1-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, The following is an updated (and hopefully final) revision of the kvm vcpu to rcuwait conversion[0], following the work on completions using simple waitqueues. Patches 1-4 level up the rcuwait api with waitqueues. Patch 5 converts kvm to use rcuwait. Changes from v3: - picked up maz and peterz's acks for routing via kvm tree. - added new patch 4/5 which introduces rcuwait_active. This is to avoid directly calling rcu_dereference() to peek at the wait->task. - fixed breakage for arm in patch 4/5. - removed previous patch 5/5 which updates swait doc as peterz will keep it. Changes from v2: - new patch 3 which adds prepare_to_rcuwait and finish_rcuwait helpers. - fixed broken sleep and tracepoint semantics in patch 4. (Marc and Paolo) This has only been run tested on x86 but compile tested on mips, powerpc and arm. It passes all tests from kvm-unit-tests[1]. This series applies on top of current kvm and tip trees. Please consider for v5.8. [0] https://lore.kernel.org/lkml/20200320085527.23861-3-dave@stgolabs.net/ [1] git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git Thanks! Davidlohr Bueso (5): rcuwait: Fix stale wake call name in comment rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken rcuwait: Introduce prepare_to and finish_rcuwait rcuwait: Introduce rcuwait_active() kvm: Replace vcpu->swait with rcuwait arch/mips/kvm/mips.c | 6 ++---- arch/powerpc/include/asm/kvm_book3s.h | 2 +- arch/powerpc/include/asm/kvm_host.h | 2 +- arch/powerpc/kvm/book3s_hv.c | 22 ++++++++-------------- arch/powerpc/kvm/powerpc.c | 2 +- arch/x86/kvm/lapic.c | 2 +- include/linux/kvm_host.h | 10 +++++----- include/linux/rcuwait.h | 32 ++++++++++++++++++++++++++------ kernel/exit.c | 9 ++++++--- virt/kvm/arm/arch_timer.c | 3 ++- virt/kvm/arm/arm.c | 9 +++++---- virt/kvm/async_pf.c | 3 +-- virt/kvm/kvm_main.c | 19 +++++++++---------- 13 files changed, 68 insertions(+), 53 deletions(-) -- 2.16.4