Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6244861rwb; Sun, 11 Dec 2022 22:06:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf6swvaMLp+IXWWsnh7X4Wpq5HgELKJ63iXMfDLIbdGk1+EW4CGbywOO7VS37BtCrUJYVAae X-Received: by 2002:a17:906:a0d4:b0:7ad:9f03:b330 with SMTP id bh20-20020a170906a0d400b007ad9f03b330mr12752423ejb.62.1670825217385; Sun, 11 Dec 2022 22:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670825217; cv=none; d=google.com; s=arc-20160816; b=qKFKgc0S4+IJhfGzcUJwgWhTsYSVO68d+gLhoR8rbsyjbqbGNj1brHxgQjC03UQKEw hFxDr4WkVnaXH4R5ghOogXfZTR22L9zRDrtkUHs5ahQHjmE/ZVLLBr1yHI3piEPYxeCE fABShfNIYOG/aOEoJ7NSYHFnr0BjYC0LaYGswlCbVsh+pP2b53KVAneY/ckWLng0J4qD uFm+T3lgPF3OB/JCy2TZMo3gcWcMWMru4gXdqQ7M3vfaEypvNQyN2vZsvnkq+Aj8b0eq w8oa43SCLuxZ1suTayUwT+i0OoFoqYfUDtFucnSB3fWL7SS5DTSbYPygEUGjA7bwX/Ip b6Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=U9YButPqEGGSX9xbkqlpyWTzGu0h8bPsQbZrD1r0BaM=; b=UDtsTpERN8+zRTzkVL1xTc2MopLSdO4gYN+JycqtWf6CxXFl3OvGAzr5x3Urgj9tEs 23qaMrJPIuwb5MWGxM+fSBftzeXb2zc8xmE4AxZ35WenlgdfSS4+Byr8UaDLC5bA+m5M UV9fuLZATswWrxCvOzFKYZL/AVspDBEIKI10kswSoVjQ0zFkULnHTmHoaHTb9lFAigeD NZLw4cbriLUNHfJWKIK8sPTqJ9HhTPcTxCXwZMMy9ffp8nwMxh6d6r5H8PGNy76PFokW wen+8USk0Ovis1yFvejKnIuXiJQn00Jfp4sBIk+jnMz4q+MQMNwRCHuuU6xB4L1EynSI 7MrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=Mbr6OgAa; 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=inria.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc31-20020a170907169f00b007bc5528a4d7si6629973ejc.47.2022.12.11.22.06.39; Sun, 11 Dec 2022 22:06:57 -0800 (PST) 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=@inria.fr header.s=dc header.b=Mbr6OgAa; 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=inria.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231197AbiLLGEG (ORCPT + 76 others); Mon, 12 Dec 2022 01:04:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiLLGED (ORCPT ); Mon, 12 Dec 2022 01:04:03 -0500 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9822B1C5; Sun, 11 Dec 2022 22:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=U9YButPqEGGSX9xbkqlpyWTzGu0h8bPsQbZrD1r0BaM=; b=Mbr6OgAao4w4oaqXASWDbDH+E4WsYGmURaGXreEuSlOVI6NxobgmFLDm 0fXBQKVgpcZlyjk/5TlnfCEWeHcbx/21CC2C98av6PaZHYoIR2JfLZ2qJ o0GSkREMmMot1eU/20xWi5LoV97JkMoAvqqdSiZFTYOqUanRIO42mWZ5Z 8=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,237,1665439200"; d="scan'208";a="42358754" Received: from 214.123.68.85.rev.sfr.net (HELO hadrien) ([85.68.123.214]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 07:03:57 +0100 Date: Mon, 12 Dec 2022 07:03:56 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Tejun Heo cc: Julia Lawall , torvalds@linux-foundation.org, 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, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@kernel.org, joshdon@google.com, brho@google.com, pjt@google.com, derkling@google.com, haoluo@google.com, dvernet@meta.com, dschatzberg@meta.com, dskarlat@cs.cmu.edu, riel@surriel.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 14/31] sched_ext: Implement BPF extensible scheduler class In-Reply-To: Message-ID: References: <20221130082313.3241517-1-tj@kernel.org> <20221130082313.3241517-15-tj@kernel.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 On Sun, 11 Dec 2022, Tejun Heo wrote: > Hello, Julia. > > On Sun, Dec 11, 2022 at 11:33:50PM +0100, Julia Lawall wrote: > > > diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c > > > new file mode 100644 > > > index 000000000000..f42464d66de4 > > > --- /dev/null > > > +++ b/kernel/sched/ext.c > > > @@ -0,0 +1,2780 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 */ > > > +/* > > > + * Copyright (c) 2022 Meta Platforms, Inc. and affiliates. > > > + * Copyright (c) 2022 Tejun Heo > > > + * Copyright (c) 2022 David Vernet > > > + */ > > > +#define SCX_OP_IDX(op) (offsetof(struct sched_ext_ops, op) / sizeof(void (*)(void))) > > > + > > > +enum scx_internal_consts { > > > + SCX_NR_ONLINE_OPS = SCX_OP_IDX(init), > > > + SCX_DSP_DFL_MAX_BATCH = 32, > > > > This definition of SCX_DSP_DFL_MAX_BATCH makes the dispatch queue have size > > 32. The example central policy thus aborts if more than 32 tasks are woken > > up at once. > > Yeah, scx_exampl_central needs to either set ops.dispatch_max_batch higher > according to number of CPUs or flush and exit the loop and retry when > scx_bpf_dispatch_nr_slots() reaches zero. Will update. Since there could be any number of waking threads, maybe some kind of flush and retry solution would be better? julia > > Thanks. > > -- > tejun >