Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5990393rdb; Thu, 14 Dec 2023 05:41:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHG3V2BAlZJSRhymFB9MR/dQNhIQgooM4gIkoALdQLGDB6gC30kqdU8hyeciAOnq9ftEapQ X-Received: by 2002:a05:6870:b004:b0:1fa:bd0d:3589 with SMTP id y4-20020a056870b00400b001fabd0d3589mr11704790oae.18.1702561304953; Thu, 14 Dec 2023 05:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702561304; cv=none; d=google.com; s=arc-20160816; b=LBZmtwcmyocEGyyUbTrJ0L6tHA1DA0Lmni9UX0GcmIQAuoGNTdXquMcPxZx8DIF3T5 F+IyfzUyctrIBDPNEXR7jB6qHDqW1XfL67ve4VWmxV7AbLz/xSHGc4JqUFtfcLqRVGaq KNfgGkmka09H5Nk7aYkBDfslCexPHaRzHPPmY5XshwMNeBbCGWbClGhNkRxMiv4zk66/ V66bFSoWmqzMM15vyYNjkPA/Lea6e11UazZIBCFleov5vbeNcMcLgiUVDLuJfn7gX96R zR6VmWHmAmVGUr9c87nzoZq3eL5Vy4ZldWFUcF79mCFqESWK4bH7DVDIwxjGBbvkNHah 0e3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HWTMFVmMbEpF8wfZqrkwEarPOGCkepSoyaCCDNsAZ2M=; fh=3nG0Pii8jzxsoTt+5HQB88MmaWarzrwiptEvKhn8UAc=; b=GueicpNyco+PVotKPJ97b9/5Qk8pdcL2X8RukBeIStq9kMfP0i/2jhTRDRC4cuyBuM b9sDlWtNG19q+KEA1HHZ1Luu7mlAocE8nUc95j8sYzjyV9R0kixYs4AgOaYbhW1dSXpQ 94L+0I1ynH7VzQldaHKlgJmxXLcNLV/Ba4X1x6qp3iuMLN8o2wgWnIsVuDMpQCFdY1E7 VyoKWm5efM2BoFpf/n1pdSlVxH+C0yL1dRFZBJIO+LX9DpdHekzo3/98jx8gBJ67Yusz NmYOXH3CTXxjwc1LgqHI2CEHdrteoNxveUXwT/6pT19+Jg8V+j6MGP/n8Y7Y7zrmT7Na G9Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2NqE3H6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v3-20020a655683000000b005bdf5961d93si11532225pgs.387.2023.12.14.05.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:41:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2NqE3H6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 03CDC80E7626; Thu, 14 Dec 2023 05:41:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1572942AbjLNNlY (ORCPT + 99 others); Thu, 14 Dec 2023 08:41:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjLNNlS (ORCPT ); Thu, 14 Dec 2023 08:41:18 -0500 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDF9C1AA for ; Thu, 14 Dec 2023 05:41:19 -0800 (PST) Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-59082c4aadaso4389532eaf.0 for ; Thu, 14 Dec 2023 05:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702561279; x=1703166079; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HWTMFVmMbEpF8wfZqrkwEarPOGCkepSoyaCCDNsAZ2M=; b=b2NqE3H6GM3cAA/h1JNyAZhAW+hK6UkteiZNI+8h5ld5AQwf+rOUSg5ZEmaxv7v6JE LeMzjwaSbAdxzTHNH3DAmxKU+8UPx1VEbahsGpnDKBWjZ+GYN4rw7NVMD2d7zqrsUWiZ WVe2dT1ItGOKIRfloYn8o8KpevLHrXJMnM6qUfioyacuw2ZeDg0k5xH2fqfA0yv4u8Re YWB34kqP/SZSQMncAsRUDUPNBqpujQ/z6aSWFLyCqTXZkZwXs8dUwT+QsRQr9AceOUur l2dp4Tg9EwD8XyaIdxDL68BamBZyAOBSMyaBssDXT9AlA/fdfZWdYpH8Khf7WhtC8m5Y 3guA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702561279; x=1703166079; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HWTMFVmMbEpF8wfZqrkwEarPOGCkepSoyaCCDNsAZ2M=; b=vbe6U0XFXGq6UX3iSeWvnxR6tq8xbLaGHuSrvIt7V+RAqWNc3BRz4Usv26oVsDfkQk SU/W7+ms+Scz0IQv1dNfZJqionQIEt98AdMJFH0UFavcT33zxWKOVEaaEWrxaydUaLrf DzHvKZlcTwOzpFgZdDgAGE6DEkFcyIiOS15ABfXtUI+AbDZtlPyEu8/yv1PX4Bs63gvc 9rUibxEggGDFluTbvmXI/RNMy81QRIcMEaHVIUdIkjl6eUVgYu5YMOTvOga0aHMPgEkN 6Kso7VDziEpJ8jVGZXB3HdWsYtPPZyPkNnAVj/5zlx1VashggrffoI/0YxFV57rN6tq5 Q8sQ== X-Gm-Message-State: AOJu0YyQSYwqJZqvcwTCDYY3zAF4EuaE8XGo0qwZ4y2yzudvWQysYYbr 2P5aHL+NogozKpKNI3ELNYvEPjjlJHQ7Wlo9xAcFMw== X-Received: by 2002:a05:6358:722:b0:170:c2d0:7225 with SMTP id e34-20020a056358072200b00170c2d07225mr7561558rwj.7.1702561279072; Thu, 14 Dec 2023 05:41:19 -0800 (PST) MIME-Version: 1.0 References: <202312141319+0800-wangjinchao@xfusion.com> <83099016-f609-4ac0-94ab-909ac9c96582@bytedance.com> In-Reply-To: <83099016-f609-4ac0-94ab-909ac9c96582@bytedance.com> From: Vincent Guittot Date: Thu, 14 Dec 2023 14:41:07 +0100 Message-ID: Subject: Re: Re: [PATCH] sched/fair: remove next_buddy_marked To: Abel Wu Cc: Wang Jinchao , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, stone.xulei@xfusion.com Content-Type: text/plain; charset="UTF-8" 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 14 Dec 2023 05:41:39 -0800 (PST) On Thu, 14 Dec 2023 at 13:23, Abel Wu wrote: > > On 12/14/23 4:18 PM, Vincent Guittot Wrote: > > On Thu, 14 Dec 2023 at 06:20, Wang Jinchao wrote: > >> > >> Remove unused `next_buddy_marked` in `check_preempt_wakeup_fair` > >> > > > > Fixes: 5e963f2bd465 ("sched/fair: Commit to EEVDF") > > After this commit @pse preempts curr without being the NEXT_BUDDY, but > IMHO it should be, so how about this? > > @@ -8259,8 +8259,11 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int > /* > * XXX pick_eevdf(cfs_rq) != se ? > */ > - if (pick_eevdf(cfs_rq) == pse) > + if (pick_eevdf(cfs_rq) == pse) { > + if (!next_buddy_marked) > + set_next_buddy(pse); I don't think this is needed because : - NEXT_BUDDY is false by default so pick_next_entity() will not take care of this - pick_next_entity() will call pick_eevdf() which should return pse unless another se that want to run 1st, wakes up in the meantime and we should probably not take into account next buddy in this case > goto preempt; > + } > > return; > > which will align with before.