Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4791950rdb; Tue, 12 Dec 2023 09:22:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjvKnGUtTkeiv/nmjUmz7TwEN05znvfonkuvnG4nx5APKXfn3tqYAtLEdeS2JcgA5W+pMY X-Received: by 2002:a17:903:2303:b0:1d0:6ffd:e2c5 with SMTP id d3-20020a170903230300b001d06ffde2c5mr8721144plh.95.1702401770706; Tue, 12 Dec 2023 09:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702401770; cv=none; d=google.com; s=arc-20160816; b=LINSqtI27oQNwYZauqXHzJuIVAwDcNTngrkbOPcaLTXRfLtXBvFA+Z5B8JceTmGPMs du8U0CBWmnqtljn9NSOO8EBR/lkwQle3GYr/dqQgs+q7m/ZEsePtGWscXlReC421gnMA csQ/MTKheAOo5vamrINEehG/VKNOjgecAIDE1be4EEy5DQ7wEFALVi5e085J49n/CHeL g267Yl/AeSeuJmj4pYtVHkfcP3OyVy+BpSWZr1amIpd+ggz3gK4XmU3uhnjwwr7T19rO p/yk0xe7731ugaCoPpJZBTvNEuBPqeLWfkvDfMhezVRuvAhNG2vIQuZxY/xvwwZoO+OD Y9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ROCp0xNd0wyqOc7nplsrZkpuLfarMjHYIQNZwVviJ7k=; fh=Nt7FZ/hYPJEV5Fc2C2k5Is1CQV7cmReWWsQUVHK3PLc=; b=P5PYMr0/FC2IQYVEsdNa8sk70E6PKS9RQK4grVg4LpvhD/7NHque/EV0kWXIvIjYjh 2eBUcSxSvZo1+zlGyblunqN71BgxOD5ULn/v7SGUWBBV8Z3lPHc2XkIyimCYLwFhMwDN QWMLyAirxmoG8J8ZZnqDz4RWO0uhT36+XqsIdCATQxDnHlx3oypsQheO93YfWIlcDrNE BcWg7ADL/hjJ1AJhT5KPxD0BFR25HAyB1B9gViHgTWZMgw9YzCPXUWeA7dCQnXiE8Ldm 9E5FeKOWzBXJ0c635YwDnTApidYz6ouFqyJFQHEJMzof+t7DzcHG+F7zlvs2/ZEP1OvQ 1lWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HnM4jinW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id d4-20020a170902b70400b001bb9375b349si8065545pls.536.2023.12.12.09.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:22:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HnM4jinW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 80AEC8048C0A; Tue, 12 Dec 2023 09:22:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376463AbjLLRWc (ORCPT + 99 others); Tue, 12 Dec 2023 12:22:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235029AbjLLRWb (ORCPT ); Tue, 12 Dec 2023 12:22:31 -0500 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5567F8F for ; Tue, 12 Dec 2023 09:22:38 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1d34350cbe8so4025665ad.0 for ; Tue, 12 Dec 2023 09:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702401758; x=1703006558; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ROCp0xNd0wyqOc7nplsrZkpuLfarMjHYIQNZwVviJ7k=; b=HnM4jinWoc7Y5b/wDcbxzJJepOv8cd4sO9RdKKADcqamDAueL8wrV0FHrWCfx3snha kb3yVOaEw20XaycdieaS9+JG3aDqvlg3rMLHPzUvrdZKKe+oObuCjpJh2kMuUU5v9xvT JbNB8Mfz5t85NmrqChVZgfsHz4/BQWiKq3Mekmx+fjBNSN5zFViZCwlKvVQx0hSmvPYO boqVaOAw0oI+3miZYt2kJU5fOatMy3jMXyJhVmgtoCpjfSy4xxzxdGN7eE0PDdnLo1OI Yo7RpJkmZDIhye5U5vsp5WjHIvgK1t98NzSPOJJq23OGuGmyh5cH+EGutSl2icqNBXHA uB7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702401758; x=1703006558; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ROCp0xNd0wyqOc7nplsrZkpuLfarMjHYIQNZwVviJ7k=; b=jJtumD7/EjTapqtTLwzNwP2iFljBBSJmENJxYGXC3/xSkeKFQXMPyRm3u1/xK6juk8 FGDfzT6T82jv3DT8/H2SuUYItxeP3h4rdyzoz23iaBJ1gIragDwq0nhOcMufxaGm6okj YsdiUXr1niCc6jodWMliAHogXYBqo2Z1mIKG1CHUhUXzCF8v4Bs/u1FZg8uViF2DL0VM 2QE/aeI2zvUNG+/jksK9vmZTA8Ondq8FCkydMi76sG/R43LZuPcokeSivHq11wA7LwkN GEfj6TED4PIaa7NvYBtFxLm6gpTNOT7PP99Z7BQKUSTT0eq1t583qVYceWQpAf7OtM9I 1JZg== X-Gm-Message-State: AOJu0Ywr4MukiuyjYNLhM+xjVKQbLQvbBWoAjnshxoVEtt9f3/F2qYY0 5UyOqa0F/VJbIjJ1/bHUmCvpn7TRSh4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:a504:b0:1d0:54ff:da25 with SMTP id s4-20020a170902a50400b001d054ffda25mr46568plq.0.1702401757577; Tue, 12 Dec 2023 09:22:37 -0800 (PST) Date: Tue, 12 Dec 2023 09:22:36 -0800 In-Reply-To: <20231212022749.625238-14-yury.norov@gmail.com> Mime-Version: 1.0 References: <20231212022749.625238-1-yury.norov@gmail.com> <20231212022749.625238-14-yury.norov@gmail.com> Message-ID: Subject: Re: [PATCH v3 13/35] KVM: x86: hyper-v: optimize and cleanup kvm_hv_process_stimers() From: Sean Christopherson To: Yury Norov 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 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:22:47 -0800 (PST) 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). > 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