Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4463035imw; Tue, 19 Jul 2022 07:06:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAEFXQwTCgaxY829ZccJymILT2NyXyRJ5o9UBAk4N64VWiGL13IMQg3ymHNv3t+K9Epd3G X-Received: by 2002:ad4:5b81:0:b0:473:4a0f:6f17 with SMTP id 1-20020ad45b81000000b004734a0f6f17mr24876610qvp.64.1658239582577; Tue, 19 Jul 2022 07:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658239582; cv=none; d=google.com; s=arc-20160816; b=ugx/Ak5CRO2bcZkZBjRnm9GXp62X6GDpSq0wBZLM8MMy8BuaM0YADfJHO07meh5K+M tfv5jlh5Uams5pu/gzW0MXBuyoZMAeQ6JPuJI7GjIOaAduS6sCLiWBOA/UY0OQDxS0dy SoEH/mf6gEcwC/rwVrJdLgc4d0INMoeAS7E8v/IKU0T+QwZjQNoPJoIpt3x1cNdtAgbp ArObdcGaZ2XfCqpDfvmtsRAVmINZ4It5uXkNlBP7AGMcambc80rPcrG0/GA5RW83taXR ocvENy7r7gTf6KQfVRiS2EcCH5AWlYJsTctCji7YkENmBKrLOdyqKdL+U9yhgrDsDKsc LXkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :subject:references:cc:to:user-agent:mime-version:date:message-id; bh=tN2mSSGa2vy2JqaMneOfP7V5hDOCsLCoS0J/lOBd0Hk=; b=zTUdBAiIl4ew1ckMJqHvTzivLq9jSPRyEtmnxdQMWbmHa8JkJ5EvYVeIo67dNL1w4F ijybyQUraMW0mHDKLfyDX0oxPgxqN/VmtFEVoHe6lGxyV0kIQOlMq2psFrfSKslQd4yk Rk/55YS58xnmUv01XH/ZMHa7O2nHKsBPiUuWcJL1AgHYsYDeRGYfQt/iDLdQpxQmMnP+ VaM1ZIBqqD3O1CfhZZpyiupAI+IRy5nk+Wj4v5yX6tOYlVT3nSFtBX+rV5qDYUyqr6nz P4BtIiBO2i0xszYSa2zL5MLLTGHufnilxn+9YKhuKIc6G4H+0np317BLK0T65a7rAejU mxYQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hf8-20020a0562140e8800b004703ca77d0esi7015559qvb.424.2022.07.19.07.06.08; Tue, 19 Jul 2022 07:06:22 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbiGSOFH (ORCPT + 99 others); Tue, 19 Jul 2022 10:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiGSOEq (ORCPT ); Tue, 19 Jul 2022 10:04:46 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE8C1474D2; Tue, 19 Jul 2022 06:17:27 -0700 (PDT) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LnK8J2QhVzlVlM; Tue, 19 Jul 2022 21:15:44 +0800 (CST) Received: from dggpeml500008.china.huawei.com (7.185.36.147) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 19 Jul 2022 21:17:25 +0800 Received: from [127.0.0.1] (10.67.111.83) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 19 Jul 2022 21:17:25 +0800 Message-ID: Date: Tue, 19 Jul 2022 21:17:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: CC: , , , , References: <20210916162451.709260-1-guro@fb.com> Subject: Re: [PATCH rfc 0/6] Scheduler BPF From: Ren Zhijie In-Reply-To: <20210916162451.709260-1-guro@fb.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.83] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Hi Roman and list, We want to implement a programmable scheduler to meet the schedule requirements of different workloads. Using BPF, we can easily deploy schedule policies for specific workloads, quickly verifying without modifying the kernel code. This greatly reduces the cost of deploying new schedule policies in the production environment. Therefore, we want to continue to develop based on your patch. We plan to merge it into the openeuler open-source community and use the community to continuously evolve and maintain it. (link: https://www.openeuler.org/en/) We made some changes to your patch: 1. Adapt to the openeuler-OLK-5.10 branch, which mostly base on linux longterm branch 5.10. 2. Introduce the Kconfig CONFIG_BPF_SCHED to isolate related code at compile time. 3. helpers bpf_sched_entity_to_cgrpid() and bpf_sched_entity_belongs_to_cgrp() are modified to obtain the task group to which the sched entity belongs through se->my_q->tg->css.cgroup. We have some ideas for the next iteration of Scheduler BPF that we would like to share with you: 1.The tag field is added to struct task_struct and struct task_group. Users can use the file system interface to mark different tags for specific workloads. The bpf prog obtains the tags to detect different workloads. 2.Add BPF hook and helper to scheduling processes such as select_task_rq and pick_next_task to enable scalability. It's a new attempt, and there's bound to be a lot of problems later, but it's exciting that it makes the schduler programmable. cheers, Ren Zhijie