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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56464C4332F for ; Tue, 12 Dec 2023 17:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346684AbjLLRf5 (ORCPT ); Tue, 12 Dec 2023 12:35:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbjLLRfz (ORCPT ); Tue, 12 Dec 2023 12:35:55 -0500 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33EEA93; Tue, 12 Dec 2023 09:36:02 -0800 (PST) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5d8ddcc433fso43019177b3.1; Tue, 12 Dec 2023 09:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702402561; x=1703007361; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AqYW6zWEA4DrVdtJ0M0uHwX0AZKuTGbkjdSNuNf9Jsw=; b=WoVNRF8XgvjVELlmulYULfD2xKLV+DTzhPLGN/vVXPZQMTzP614zexwKoNOGGKjWkk rX0U/s27DN9BAZYKd8jOC5OYfZwpWXoehkVHN4CvEY8fmP4FaDS8g0iDtowre6owgY5o zksrCP+6yNyyJNRcafXfC9WpFolCTTlD7R7EUdjO6bTNjc6hqZ0Bnky3/NUnd+l6Uw9b Xq1g3xVwrjRbv31rSFxF3aTNRAiu9RSOl8oUy0f8e/hodHnSi3dNBEDBqodfwoVvXxSr 7+YvrdY6MrBK7FdBHmN0YUTz7MbQ9WHnyhcxKZHge4HneKOtc7Wi3EEjJp6WOR6odgVw 2ggA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702402561; x=1703007361; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AqYW6zWEA4DrVdtJ0M0uHwX0AZKuTGbkjdSNuNf9Jsw=; b=HIXXa0LW2zNwFIetmj0XIbAjTB2xPSgwIDRoTSPR+Y+NIFrHBL8AhiiomM0DL5gii5 rlPgurU6+dJ2JHGLBojx+82pX7hK9uYrmXQf3Z/lUdxI3iSp03L71zRpqDEayN5BQ9nb t9n4wLGpxFx7tryZg47lBMFcqdLYL5FBgkOzKbrz8Co6gc3Enb4u6HKdqyAviyyLcFa2 Hvs7mSTtWlk0RgchQVYTN5ChoQio+DoJIM3BoAlzkaCntZdrRFTW50iC0zUiPFCQs+Fu QDQJGR+E0w8d/2xIpwmOnf95sZ0NL9pArfOBd7KEcFL53tBKFdS1vOUALmGPGNzy/tiQ W+Yg== X-Gm-Message-State: AOJu0YxjE5rEQSbeL6bMnI/vWNU5t2FJ/F4wMtdlRJRCcwzaXbRkmotf T+V8IOTnWQHiaQzaCL9O2wU= X-Google-Smtp-Source: AGHT+IE/2pSQ9yKqXyt2sZV+rUNwsE5JpJPh36RxwM+nVPxHryEkYXvEScysoA+RwrJAZ0UpUjbtxA== X-Received: by 2002:a0d:fbc2:0:b0:5d8:d2b6:6266 with SMTP id l185-20020a0dfbc2000000b005d8d2b66266mr3054619ywf.99.1702402561267; Tue, 12 Dec 2023 09:36:01 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:38aa:1c88:df05:9b73]) by smtp.gmail.com with ESMTPSA id o5-20020a817305000000b005cd9cdbc48dsm3897945ywc.72.2023.12.12.09.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:36:00 -0800 (PST) Date: Tue, 12 Dec 2023 09:35:59 -0800 From: Yury Norov To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , kvm@vger.kernel.org, Jan Kara , Mirsad Todorovac , Matthew Wilcox , Rasmus Villemoes , Andy Shevchenko , Maxim Kuvyrkov , Alexey Klimov , Bart Van Assche , Sergey Shtylyov Subject: Re: [PATCH v3 13/35] KVM: x86: hyper-v: optimize and cleanup kvm_hv_process_stimers() Message-ID: References: <20231212022749.625238-1-yury.norov@gmail.com> <20231212022749.625238-14-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 12, 2023 at 09:22:36AM -0800, Sean Christopherson wrote: > On Mon, Dec 11, 2023, Yury Norov wrote: > > The function traverses stimer_pending_bitmap in a for-loop bit by bit. > > Simplify it by using atomic find_and_set_bit(). > > for_each_test_and_clear_bit(), not find_and_set_bit(). > > It might also be nice to call out that there are only 4 bits, i.e. that using > for_each_test_and_clear_bit() will still generate inline code. Definitely not > mandatory though, just nice to have (I highly doubt this code would be sensitive > to using less optimal code). Sure, will do. > > While here, refactor the logic by decreasing indentation level. > > > > CC: Sean Christopherson > > Signed-off-by: Yury Norov > > Reviewed-by: Vitaly Kuznetsov > > --- > > arch/x86/kvm/hyperv.c | 40 ++++++++++++++++++++-------------------- > > This doesn't conflict with any of the in-flight Hyper-V changes, so with a fixed > changelog, feel free to take this through the bitmap tree. > > Acked-by: Sean Christopherson Thank you!