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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 921BEC5DF61 for ; Thu, 7 Nov 2019 13:26:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E34E21D7B for ; Thu, 7 Nov 2019 13:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388697AbfKGN05 (ORCPT ); Thu, 7 Nov 2019 08:26:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388525AbfKGN04 (ORCPT ); Thu, 7 Nov 2019 08:26:56 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB91081F05 for ; Thu, 7 Nov 2019 13:26:56 +0000 (UTC) Received: by mail-wm1-f71.google.com with SMTP id f14so772490wmc.0 for ; Thu, 07 Nov 2019 05:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=sY5GQZQRR37FgRTpgS+peb+lk0hBcwjkBJyRvYYH6Hw=; b=kfR7iNjRmccwhtUTcKIKXtPuAdrU6kZ+p8Scy+KNvnWeex2hHh07GbgRGZo8f0WOKY hsXiku1o/yNRiThU6K5UPcHogXr+X707knWf5wN3Ew8tFu3cz7G9jI+ykaE4es3XyfM7 qhlpllPlYHIMcqKAFiRVjN91H8oKUDzC7OBlIgm8ln61bX9EGLfEFWNaSRfRXiphI2Un SR7Hul5XziOa5ltCP+3YeaO+PUIAWLCMEyC2/Bw59UVNpXhVg1ByNCPenJktOuh9Fa5+ zZrUZ3JvwKia+gh96SQwfXo8iFnvN813rQQZO73D1vZbEiHYxx3DtTwZeWriVuQSb7Ld mA1A== X-Gm-Message-State: APjAAAVng8y2M5K8EDM+G1H2dGUkm+iYdEO/zINyADhSeCShyj0IKvb3 /O+hUyYV3TYYOeymjB4XIkXrSsFUUSikR4s9DzKy3ZTr3bVcjH3RD/gw0YfXN4rzZyPSLlp8618 j+3PCX1GiyaE7vApa4wXVwFZU X-Received: by 2002:a1c:3b08:: with SMTP id i8mr2855693wma.56.1573133215354; Thu, 07 Nov 2019 05:26:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxTxNfiovI0w9kYuknzKXffvwCptiTG92icmrRUIsqrAdos08hnvVnr3eQTmeYuQjClpj2+4A== X-Received: by 2002:a1c:3b08:: with SMTP id i8mr2855658wma.56.1573133215051; Thu, 07 Nov 2019 05:26:55 -0800 (PST) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id w13sm2269778wrm.8.2019.11.07.05.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 05:26:54 -0800 (PST) From: Vitaly Kuznetsov To: Sasha Levin Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Roman Kagan , Michael Kelley , Joe Perches Subject: Re: [PATCH v3] x86/hyper-v: micro-optimize send_ipi_one case In-Reply-To: <20191027151938.7296-1-vkuznets@redhat.com> References: <20191027151938.7296-1-vkuznets@redhat.com> Date: Thu, 07 Nov 2019 14:26:53 +0100 Message-ID: <877e4bbyw2.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-hyperv-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org Vitaly Kuznetsov writes: > When sending an IPI to a single CPU there is no need to deal with cpumasks. > With 2 CPU guest on WS2019 I'm seeing a minor (like 3%, 8043 -> 7761 CPU > cycles) improvement with smp_call_function_single() loop benchmark. The > optimization, however, is tiny and straitforward. Also, send_ipi_one() is > important for PV spinlock kick. > > I was also wondering if it would make sense to switch to using regular > APIC IPI send for CPU > 64 case but no, it is twice as expesive (12650 CPU > cycles for __send_ipi_mask_ex() call, 26000 for orig_apic.send_IPI(cpu, > vector)). > > Signed-off-by: Vitaly Kuznetsov > --- > Changes since v2: > - Check VP number instead of CPU number against >= 64 [Michael] > - Check for VP_INVAL Hi Sasha, do you have plans to pick this up for hyperv-next or should we ask x86 folks to? Thanks! -- Vitaly