Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4800560rdb; Tue, 12 Dec 2023 09:36:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IESNgEClCCLCKHyW9dl8vDFr9RpMGEEP6nLNH5UDPU7fUo5Wbb5zmPnh7pMX1+8zbBEUgir X-Received: by 2002:a05:6a00:1143:b0:6cd:d6eb:2f19 with SMTP id b3-20020a056a00114300b006cdd6eb2f19mr7580909pfm.9.1702402572478; Tue, 12 Dec 2023 09:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702402572; cv=none; d=google.com; s=arc-20160816; b=BHPXjFjwVmxUkkpRx1auWO9lgkNonXLKESBEbm+wa5B0OPQPxXyc1cN4EYoJ/5cH5q hRFnhmLIhjpOQjiNub1vdZ2aWk0zveddxoSpKpcsR8YQOBxJSML5HYgVHN1Pmv14Q1um UzcVDpW5PvO16m8JroKSH2KMGW84LfylNT2LxarKuX4RjiLynfHNFKFoof5+2NjdG12W gk7W8cC89I7hofs7n9DU7Ug7kQj2/708kOCL2jmf/srl6ptBlEGkID5euM8EVDXldbbU 3a4cYQG96UWvifxEbMV0kk//02FV10beNVNc8bc559P/JtEusOK25T2r6JR3vXrskOri Kz4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AqYW6zWEA4DrVdtJ0M0uHwX0AZKuTGbkjdSNuNf9Jsw=; fh=Z/ajx/y2CwBRkgI9zmnOfi9wC2c/4MEqxSVXeqosMyY=; b=S9RAI2oZ3NDcNR8xU7IYkEdVDGCaOMZG/kgU7tfIaxUYWk85TqMKB4LFtVed2ogdjt jTXIgN/4SsbR3j1wi4L7TPupub74b7Gke7YrDgRLeldQFY/nUt0XwrwA4Gdh8JPCWV5S pkplv5+t/L7t3MeRHEjpFzg2M9k4EZzLTndS0IvmkYjYWKrIb6it7KCRQ2fcf0medWc0 P0sFg9vhtLzLST/128mxHY3JxJW4n8U7Lh4KQ+7h2xgdzyxQY44t8eDxyHIRbTghXoVp 2LiPXG0gLjgVHwPUhxAJj3uxylLiDDmR88Rg+qYu4yzzfhqiP9ntsXkGZETx69VYPXiv BMKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WoVNRF8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id g62-20020a636b41000000b005c6617f183fsi8036210pgc.303.2023.12.12.09.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:36:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WoVNRF8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 09C3680A5F08; Tue, 12 Dec 2023 09:36:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235105AbjLLRf4 (ORCPT + 99 others); Tue, 12 Dec 2023 12:35:56 -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-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: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:36:10 -0800 (PST) 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!