Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5990473rdb; Thu, 14 Dec 2023 05:41:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXHopsrj4citFgLolgZBpGvotfiKq9i9ObYx7BnP/htIqmcqBy1DcmjJKOWWjVBz4iCzPs X-Received: by 2002:a05:6e02:b22:b0:35d:59a2:2bd with SMTP id e2-20020a056e020b2200b0035d59a202bdmr14089958ilu.93.1702561310892; Thu, 14 Dec 2023 05:41:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702561310; cv=none; d=google.com; s=arc-20160816; b=CUf/bP9Ld3bQ3HXwZ+TUG0ZgJK02GEDx+buRn4PJ7lLznqg87VkSa6qK7sId+XWbiR TPWwD4JgZDuLekK8j38or8ve1IFMQJHqWzUnmMh+sf4/4mYeyUK3PDvOWHPlbHmGGHl9 Z1zrU9blZ8ZpH50RtQ8hBpkSijPcB/A9T2A0boSu5tsWZDs1ybgmT9/0slgQjX47yaj1 k+DxBWO1s456lXAEAiC/xxiWXw8V777JkWErD1MJftC1Gbci/CofRFSqp9BG71y/7EsY 6Hn91xnDDoQrLaUJ294OPJlnGPwfv+Y0Zq1Bi2oTobjIAtLi44kOdFIgUY23M+18WxsQ QlGA== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=AKUzf/bq7okvr9gibq4dngEFELPnNApNctO8aNYKtb0=; fh=4lkSZ5wlCXCHSDQLcUbvRgpcUuH6m9QwweZAaJI+iu0=; b=t32RjfavBF/T9mpZQ0pgQ83YlVIN+PaHFg+HdXUc1CiAcz4fOu0A/wy4klXnEif25t mYBIKFkQUWKnBLXNdN8mhgC65H7vHdKVEYCQUT6yWSzsZL/7zdPp+OkaR3WhTgulkvuY tSywaz+48igWCSOf6UIzOXgsOXHR7sIwrioHtoqymed6v6XrokQLcwDZGYlPhL4ZRvpi WDoVqwFeOhgr36pAEJ/4MJ0iybxuTuUps/yKx8S+zVuw2EsT4iUrGKc4U2YBbPuxti8m x2VQGS86ge4Gn/CJttx0uVB2gK3P6nPkX28xHmgNJwF6EdcIijycNqY38uyonr6Oh8DE sHyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=lsA97wLI; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bz42-20020a056a02062a00b005c660726916si11449404pgb.515.2023.12.14.05.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:41:50 -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=@bytedance.com header.s=google header.b=lsA97wLI; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7B46180E8577; Thu, 14 Dec 2023 05:41:47 -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 S1444153AbjLNNl2 (ORCPT + 99 others); Thu, 14 Dec 2023 08:41:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbjLNNlV (ORCPT ); Thu, 14 Dec 2023 08:41:21 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 892F9125 for ; Thu, 14 Dec 2023 05:41:04 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d0bcc0c313so44004525ad.3 for ; Thu, 14 Dec 2023 05:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1702561264; x=1703166064; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AKUzf/bq7okvr9gibq4dngEFELPnNApNctO8aNYKtb0=; b=lsA97wLI6CP+CiKpeB18H46/QfMznASfa0Sc79QTJbGRUAuafEoDi+77aZ9YWNxNmA /rM4P3Ha5udg/UuvEi/7EZkFWNq+aR4s0cEUXj4lKM8mOXDoBwkLCN30HcTpcnxOwQ+q Ff7b2mLzgcz3mKYizOp0Yr4M2KuNJtOuAgD3ocatHp4+3Xn+HrPwaRHp8U3H/NOPeqAj zQ165WUwqaNFhzmcs/SP/yz3uA3rjIuOyS5stIOx7qyJIHLjMGTaVZWkKoLYhg17Z3An G+MEmta2ReWKnrJyvhWP8TmgT8TAHGlN9Aq/aYajOU2YDAxpyT12sdhTDuYFDtcLb0lV +L+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702561264; x=1703166064; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AKUzf/bq7okvr9gibq4dngEFELPnNApNctO8aNYKtb0=; b=T3fx2b5d2Ca3o9sRYkQJFQ+nms/ndRCU1gNkz6n/IsNEVdN21U9xwrENVp9HSyXEoS j093OgHY7ru+AS3k7JYH443h27xQWljoq2zsk89FGlLoK21gDt8RXtaV9bJna8By95P9 RHtwsOuc6OAPa+qqHLDjdAkm5YuzcJ3bPMd1UD1AMHCi3yf7SMFbNMvRa3UmZIVeTuZ7 xx8NZgiM/sghDP8nwR8DHSFTEx2rmDMV8o8bvrMllL81k1G3yeCRpKCC2kW0PLZlKr5p NoyOofOU2fBCz4cwb+SESsL3cbyyz379X3guyPG6LGE7SA75fnH/fvPJ7NMRPKsTtPcl 3ang== X-Gm-Message-State: AOJu0YwDolI9biL/xxcnLhL32Azzp8SQ/6i/0NTHUaRs7nGjzQb09SWK BhqDhIbcwD+jcfND3R6oB1P8bw== X-Received: by 2002:a17:902:db06:b0:1d0:8383:7433 with SMTP id m6-20020a170902db0600b001d083837433mr5054661plx.36.1702561264001; Thu, 14 Dec 2023 05:41:04 -0800 (PST) Received: from [10.254.92.96] ([139.177.225.240]) by smtp.gmail.com with ESMTPSA id x10-20020a1709028eca00b001cf570b10dasm1222765plo.65.2023.12.14.05.40.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 05:41:03 -0800 (PST) Message-ID: <863ba31e-8df3-4168-acfc-503bfe1a0aac@bytedance.com> Date: Thu, 14 Dec 2023 21:40:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: Re: [PATCH] sched/fair: remove next_buddy_marked Content-Language: en-US To: Wang Jinchao Cc: Vincent Guittot , 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 References: <202312141319+0800-wangjinchao@xfusion.com> <83099016-f609-4ac0-94ab-909ac9c96582@bytedance.com> From: Abel Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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:47 -0800 (PST) On 12/14/23 9:02 PM, Wang Jinchao Wrote: > On Thu, Dec 14, 2023 at 08:21:53PM +0800, 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); >> goto preempt; >> + } >> >> return; >> >> which will align with before. > Seizing this opportunity to inquire about a question: > What does "buddy" mean in the context of the scheduler? struct sched_entity > > Is the effect the same between > preempting after pick_evfd(cfs_rq) == pse > and > preempting after set_next_buddy(pse) followed by pick_evfd(cfs_rq) == pse? > Would both scenarios result in pse becoming the next scheduled se?" Probably, since pse is the one preempts curr, pick_next_entity() could return pse directly without walking the rbtree. So the difference is in performance.