Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1217606rwb; Thu, 22 Sep 2022 11:44:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5MhMraxfrzerNbpqqVcvf++giSfJJvOTisIEQ1uHtui88R8yXcB8spBNnkhhNzTDUn42p3 X-Received: by 2002:aa7:c849:0:b0:453:9543:6ef3 with SMTP id g9-20020aa7c849000000b0045395436ef3mr4801006edt.105.1663872241594; Thu, 22 Sep 2022 11:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663872241; cv=none; d=google.com; s=arc-20160816; b=JiUR4SsX1T7CuwwBltgEK22YuHyfYL/e9ldBzYQWErAmw1XzFeZkB0e+UIDb05VN61 2xEjelZ/Iyoz5kcG/cPIWen+KssvMqMSoFkl/Uye9/FjlW6z5WIywbSRdKsKbiY35J/o R8HtrHMP8KUslf6PBCB6D6wa6TasNXUjLlZTiPZa2pBnlAqAeXloBjpXTLP/mirHb8xC rTBV1T0IJJ4MVe0K6OTKS68KorUcNdzwOCEZ93gzvEVYYK923PSeoMmkLfHFNNFkMLd1 7C74gn4rtB6R3rrsL7ZOvRis+SgKZkJflrtLfOLvk5MVrxt2nwOKTSFLR0PmeIlbVckr KbDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d7F5jNXOig7p4gZdg2FFWDOqFX0Eoffdyr2osFUuJU4=; b=uJFkyiLNB1z+BqkuFtOUnS2BnIVKdLj1KHgbTILk9l8hLgxmVI4bikQup/HjWGPmLb f9Yi1X6xeqZtelD4wzf8Txm6M0iHwI+1NJAfBHzT3mIZP0t+tvhf8QgwgNfPMxhoF5VS yDC67oMA04O4IvMO+f3u+uJOhPZ37zMi4bBEPF5X1ufqFzTKVxpCnlXJEOEZ0lMEpoL7 pMRCitzX8zyza+gMhTFqRzZAnnJCpdj5DthrZ6oyGfM0uDMdWhJW94iZbCndKvJPNyx2 Wt6xg7KeuupjAcV1bx64OYtLgi7OR+X004imno5sUX9ibkPcpcyx5lyktDwcyhXPvIjR DPGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LaVbi0xe; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr39-20020a1709073fa700b0077951929340si2634086ejc.271.2022.09.22.11.43.35; Thu, 22 Sep 2022 11:44:01 -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=@redhat.com header.s=mimecast20190719 header.b=LaVbi0xe; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232351AbiIVSCM (ORCPT + 99 others); Thu, 22 Sep 2022 14:02:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232242AbiIVSBT (ORCPT ); Thu, 22 Sep 2022 14:01:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C23AA4C4 for ; Thu, 22 Sep 2022 11:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663869674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d7F5jNXOig7p4gZdg2FFWDOqFX0Eoffdyr2osFUuJU4=; b=LaVbi0xeMzwFfI8DJItalVrfzghvtsnJhxnLNn0x5DCEO1+10fYkNwQy+fxTHswIFsmMm0 ZaUXbf4VXiEKuGL2Cic2WIVVHU3tGdc1Ni1+aQ9JqcQyojHFe6jtQZ2Z8KfwE9Fqb/tZxO wukLoeJ8Vte4cIdAi0ZjfglyimBOC2o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-F4yJqfX3NfaHkY9kTKG-NA-1; Thu, 22 Sep 2022 14:01:10 -0400 X-MC-Unique: F4yJqfX3NfaHkY9kTKG-NA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CB431C160C4; Thu, 22 Sep 2022 18:01:09 +0000 (UTC) Received: from llong.com (unknown [10.22.33.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8EB0140EBF5; Thu, 22 Sep 2022 18:01:08 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Zefan Li , Johannes Weiner , Will Deacon Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Lai Jiangshan , Waiman Long Subject: [PATCH v10 1/5] sched: Add __releases annotations to affine_move_task() Date: Thu, 22 Sep 2022 14:00:37 -0400 Message-Id: <20220922180041.1768141-2-longman@redhat.com> In-Reply-To: <20220922180041.1768141-1-longman@redhat.com> References: <20220922180041.1768141-1-longman@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 affine_move_task() assumes task_rq_lock() has been called and it does an implicit task_rq_unlock() before returning. Add the appropriate __releases annotations to make this clear. A typo error in comment is also fixed. Signed-off-by: Waiman Long --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ee28253c9ac0..b351e6d173b7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2696,6 +2696,8 @@ void release_user_cpus_ptr(struct task_struct *p) */ static int affine_move_task(struct rq *rq, struct task_struct *p, struct rq_flags *rf, int dest_cpu, unsigned int flags) + __releases(rq->lock) + __releases(p->pi_lock) { struct set_affinity_pending my_pending = { }, *pending = NULL; bool stop_pending, complete = false; @@ -3005,7 +3007,7 @@ static int restrict_cpus_allowed_ptr(struct task_struct *p, /* * Restrict the CPU affinity of task @p so that it is a subset of - * task_cpu_possible_mask() and point @p->user_cpu_ptr to a copy of the + * task_cpu_possible_mask() and point @p->user_cpus_ptr to a copy of the * old affinity mask. If the resulting mask is empty, we warn and walk * up the cpuset hierarchy until we find a suitable mask. */ -- 2.31.1