From patchwork Wed Aug 9 16:49:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 133349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2956532vqr; Wed, 9 Aug 2023 10:22:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQVLZAcMyQksEWWYZ+GGlyonTjtRkyf8zgbgTunSodKVGHLrei89YzDQITA2Ocpxr6oHVf X-Received: by 2002:a17:90a:14f:b0:263:c0f9:451c with SMTP id z15-20020a17090a014f00b00263c0f9451cmr2422330pje.3.1691601735549; Wed, 09 Aug 2023 10:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601735; cv=none; d=google.com; s=arc-20160816; b=sC4kPmW46f7wkf1SZXuvEqB/K1032xttBzxYNshcOPtVtIh69cUEdjasF6kLSmnKvY oKqM8mTENan3BB5WeU7cyRIhMrT0bFJaCjDMenLhPseu5ZZWjRIrEuokXN0xk1vaO8Vq V8PsBNEf+Rn0/XBOdgezAzuhrASwG9TvyVQDcWC4nSytmDtIZ9ZZJB4Xm01XJmc3Djbl Ns0YqwpXZ0udrLr1K/bhLhkxv3b1Ed7Uj5ThJIXIcl7sVjgHGTUVv0BUnGx20BOTm2Ra eSad+1jphWxXgDqoFfi8NJ1/frX55hEWOxDSAHBCbBVeEGvDlvXTVvQN27umP5AC0pgd 6blA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=pjkPxCXxC7cnhpbrSelSZLex9foeLCjttg+yEiQhkGw=; fh=xeBNGOuZM5vy4okdFvBNsMTGHQ6tdBlFPaNKCUScG5A=; b=kFVn1nURlC8p+b6DqsYf4Xs0s3k3WrXLeZa7IZ4DgDYRJ3gU7/LJHtCbizdOJT5/9h 3Lt6gAP/bg5oVcmZJ8j9IL2AEUOCXi4Db/vv+dMqHFShhq5PZmQtDTh7J+mDEkGiN37A NH0TVp/WkqgzgdrBKmZEfwMf65nNr8SvoT/QkQNuJC2HZ6P0+1cclHAznfvpaymI8/Sk ROaAeQSFc2lplvFscC6DzFzeWsecCOEw/ChqADUpxucBrxtzHPU8CFm9KiGdZJuTvF4t iQtMM0UEzclJQmoHi7Vi0dGbiIPlNbujpRIiezPtbwqSF7k8hAu1Oto178775O4R2Cnd 3ZUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lNS9Inei; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a17090a8c0600b00263860e1f4csi1850869pjo.16.2023.08.09.10.22.02; Wed, 09 Aug 2023 10:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lNS9Inei; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbjHIQuH (ORCPT + 99 others); Wed, 9 Aug 2023 12:50:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbjHIQtl (ORCPT ); Wed, 9 Aug 2023 12:49:41 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2389F2107; Wed, 9 Aug 2023 09:49:38 -0700 (PDT) Date: Wed, 09 Aug 2023 16:49:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691599776; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjkPxCXxC7cnhpbrSelSZLex9foeLCjttg+yEiQhkGw=; b=lNS9IneinDICl16JJKu2nkMDMB/U1bib/SDOwjKgBqoeyQpUfu473aqUgW4I97deiiusEj 8HKxYbr4EKgwpiudb6JN2IWGXdw2p0495cPUy0rJgBEqPHPLRxpzQbuOtCd4RloCfuK+3W UBZe9odkWIz6YQqG3OI/2gqsIQobdvAZNTqn0pcgS7r3KNOzOZ4aP2L/sEvyZ5vAnfYckv DlvGkxCjxWHFUStgCmoJH3ZLRdwy7MQM9v4jZOMc01vAJrfStylmbxwFJasvjCm19FZC5Z qDBoIugXcNVhMPbmpdzGMBbWnErvI0dSmxxKs5ojxthewWb7KlUbOBm66FIAhg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691599776; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjkPxCXxC7cnhpbrSelSZLex9foeLCjttg+yEiQhkGw=; b=Cf0NAaWpL5Ok8bWqkjXAfok2tNAAqtGL0X+yj+dpHtoKhNFcEJZgC8GHYT2u8ZLbh9FHZt iPzQJv7xqc25vbCg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/apic/ipi: Code cleanup Cc: Thomas Gleixner , Dave Hansen , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169159977624.27769.2948671363642567492.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773772981457688089 X-GMAIL-MSGID: 1773772981457688089 The following commit has been merged into the x86/apic branch of tip: Commit-ID: be11417918c18b73113eb27741906f88f8427d51 Gitweb: https://git.kernel.org/tip/be11417918c18b73113eb27741906f88f8427d51 Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:03:54 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 08:10:11 -07:00 x86/apic/ipi: Code cleanup Remove completely useless and mindlessly copied comments and tidy up the code which causes eye bleed when looking at it. Signed-off-by: Thomas Gleixner Signed-off-by: Dave Hansen Acked-by: Peter Zijlstra (Intel) --- arch/x86/kernel/apic/ipi.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c index aa51e16..2ff9cf9 100644 --- a/arch/x86/kernel/apic/ipi.c +++ b/arch/x86/kernel/apic/ipi.c @@ -184,18 +184,13 @@ void default_send_IPI_single_phys(int cpu, int vector) void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector) { - unsigned long query_cpu; unsigned long flags; + unsigned long cpu; - /* - * Hack. The clustered APIC addressing mode doesn't allow us to send - * to an arbitrary mask, so I do a unicast to each CPU instead. - * - mbligh - */ local_irq_save(flags); - for_each_cpu(query_cpu, mask) { + for_each_cpu(cpu, mask) { __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, - query_cpu), vector, APIC_DEST_PHYSICAL); + cpu), vector, APIC_DEST_PHYSICAL); } local_irq_restore(flags); } @@ -203,18 +198,15 @@ void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector) void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask, int vector) { - unsigned int this_cpu = smp_processor_id(); - unsigned int query_cpu; + unsigned int cpu, this_cpu = smp_processor_id(); unsigned long flags; - /* See Hack comment above */ - local_irq_save(flags); - for_each_cpu(query_cpu, mask) { - if (query_cpu == this_cpu) + for_each_cpu(cpu, mask) { + if (cpu == this_cpu) continue; __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, - query_cpu), vector, APIC_DEST_PHYSICAL); + cpu), vector, APIC_DEST_PHYSICAL); } local_irq_restore(flags); } @@ -283,7 +275,6 @@ void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector) local_irq_restore(flags); } -/* must come after the send_IPI functions above for inlining */ static int convert_apicid_to_cpu(int apic_id) { int i;