Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp780117rdb; Tue, 5 Dec 2023 22:34:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxjCLSjPv/qGqG9t//hB9myIbd4b3+YFbffhG4H04UACDwubdN/DwiBsG/t2c0Vt7ABEbs X-Received: by 2002:a17:90b:4b45:b0:286:b2ca:4bc3 with SMTP id mi5-20020a17090b4b4500b00286b2ca4bc3mr490042pjb.32.1701844480918; Tue, 05 Dec 2023 22:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701844480; cv=none; d=google.com; s=arc-20160816; b=uIyK2Kf5S5yPycONBBIEDYvpjiaNnwFXZEt4n7PyvxJ90CbwTahyV6q26tcAD7k7kr du+3zundWR+0gvR5YqY9QaEAVdC13oa2KSZt8moJf1Ay9/YgjuEguIbksGPRCPuZFt2d RkztdEGO6nJruu0Hpe2bxgcXVZnEuz2tU4jdpSRx3HrYqTn1Mir1fRsi3t/ULY5U+m4V TsjGIFVOaZmEXlJJp5Fo0CFJM2G8ykB02ySa+z47CUYJrvrUhlrPHu7ifmLeG/gWcCp0 uR6v+7CVsI8H9JGfC+gkCJE1+QfAbJTHlhVvtNMolb8drP9A9rxGTLSShrOh4vpHL4yf fwjA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Z+0l8mPsxCbaNspPdfHc0kRxENqvlPASHVuR+idjaYg=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=ImKgTuJGVjX+uF0lkMnOn0BCtKhg2FONkn4j7YoyM4Zad4FugM39sXU2Ay0tV2NvDn 1WJ2J7bm6i5ImFcn68zVs3+TlL5KXEg8Zg25U3Zczioa/cG0VG4vJSO8bs40gjKC+b1Z DBUezzUXE0QsJntBPWptuGTlyE5rXNnt6TJU2e5vq/O+tS+8UZDe8hvzZW6EwG2q0mYk ciz2g8x/n31Jpm17GvYrL1cvpioguWFGUwzexlkMxPRug9hCF2u+GDIaWFANajXJuZar USXysCpFsH7yoSnp+alEHWqziOlkXXSWVkJR85h9mHl29vCXDsw4bDNnZ5uVE7DMzqjR hWYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=RTKmWoeH; 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=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c20-20020a17090a8d1400b00280664dd1f4si6984896pjo.9.2023.12.05.22.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 22:34:40 -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=@linux.dev header.s=key1 header.b=RTKmWoeH; 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=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id ED12080B8F33; Tue, 5 Dec 2023 22:34:36 -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 S1376732AbjLFGeU (ORCPT + 99 others); Wed, 6 Dec 2023 01:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231374AbjLFGeT (ORCPT ); Wed, 6 Dec 2023 01:34:19 -0500 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E72B11B2 for ; Tue, 5 Dec 2023 22:34:24 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701844461; 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; bh=Z+0l8mPsxCbaNspPdfHc0kRxENqvlPASHVuR+idjaYg=; b=RTKmWoeHMIk6yFrnjQq47mI/+cQyHVlQIbF3SYOiLIx80M1OT/woOCkKluhDwxwqgIhfdw N/q3R5umJRjL3g8wnFyK9Lq0kSGK96opxbRk8jS9QmcRlr88sXW4+aV540+W72d4b79V/N IoVUUxPlcxeMZFRJpAuh06yL0wSVbLI= From: Yajun Deng To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH v2 0/2] sched: Return NULL when entity isn't a task Date: Wed, 6 Dec 2023 14:33:58 +0800 Message-Id: <20231206063400.3206346-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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, 05 Dec 2023 22:34:37 -0800 (PST) If the entity isn't a task, return the task struct is meaningless. Return NULL when entity isn't a task that makes the code more concise. v1 -> v2: fix 'struct rt_rq' no member named 'highest_prio'. Yajun Deng (2): sched/fair: Return NULL when entity isn't a task in task_of() sched/rt: Return NULL when rt entity isn't a task in rt_task_of() kernel/sched/fair.c | 50 ++++++++++++++++++------------------ kernel/sched/rt.c | 60 +++++++++++++------------------------------- kernel/sched/sched.h | 4 ++- 3 files changed, 44 insertions(+), 70 deletions(-) -- 2.25.1