Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2006327rwr; Fri, 28 Apr 2023 05:05:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Q6Vhk0BMksDgZGUtEzwcQtBRxVz8Rg0QFJuV2uLBUmTXWriqnVWwyFjZZY2ax04FlCwz8 X-Received: by 2002:a17:90a:98e:b0:247:90ea:1a81 with SMTP id 14-20020a17090a098e00b0024790ea1a81mr5340425pjo.37.1682683540151; Fri, 28 Apr 2023 05:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682683540; cv=none; d=google.com; s=arc-20160816; b=CtrSonbCzlWeLpgXcQrBIoYyleaFDOlxIaaV+FQzh0P7svp4RFbbRBk7zZ8uhy7XUF JMjR7PyKyfqP38nSOEZfcd9YfMntVjatB0KkugV+ykh0BkHusm3IwTogrcrsdeKGtpNg EMj7sjx9tyRcELR9JZM9v1cDOOWthPg6xkgqmWkIdHqxDjNKp5wGg2dMxkAQAzjfEVo3 dZG0WxNIdXeTUqnNEcmmIcwXZvQ6pnmuGsfFfiO0kcmNCtKR0ppeAec3eIZkgPc0xytS 3drfnXMC0HUomrQbAFhpbuvXR1h//i+Mp+Ll+QojLyzFdKUswZt162Qq23KqK7qmwqJK KrTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HsX+f2IVkrgIdegQ6uKKgRhQWYSnAO+rZAXPTc6eFzQ=; b=JkYuPsTLiKvVgrqgpDmJMQjtgzYe2GpWLGETLGRyJ5Fc2BwbAU9h+XWbysTsdej92q FARtZEyADv635SPo/dFdiu9tKgqINyabHr58tB6YYp1o7TCg8xPFh9rT0Jt2VBtMHJw+ SQtxH0D6zCKld0AaAsStp6OPkEVYT04bRl5k5ar2siH8T2AMFWGtgNt4kjDAZJqtmHcn +XsAp4VJHrbW+g2OFR1TZ4MeZ68j1NoVMhp7UzkAD1mBxI4zjZ/J6zYtt+BT0hsITW+j 8/n96uZ2ZwJ58ByD3W1iPBXpJ3rHkE2FyaSt6WcEVYqhXaZRf1UOjcE9wktDPpb1FEPA HR7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20221208.gappssmtp.com header.s=20221208 header.b=3jJQnCut; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a17090a6b0600b00246b845f3efsi23360908pjj.80.2023.04.28.05.05.22; Fri, 28 Apr 2023 05:05:40 -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; dkim=pass header.i=@layalina-io.20221208.gappssmtp.com header.s=20221208 header.b=3jJQnCut; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbjD1L6C (ORCPT + 99 others); Fri, 28 Apr 2023 07:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbjD1L6B (ORCPT ); Fri, 28 Apr 2023 07:58:01 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B521BEC for ; Fri, 28 Apr 2023 04:57:59 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f19a80a330so48764475e9.2 for ; Fri, 28 Apr 2023 04:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20221208.gappssmtp.com; s=20221208; t=1682683078; x=1685275078; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=HsX+f2IVkrgIdegQ6uKKgRhQWYSnAO+rZAXPTc6eFzQ=; b=3jJQnCut07J8zy9Biyr+bO/xtD8DeDGs2SxiwURex4qhDQ1Wb01+iECUaNheV/doqD OG9nnuhy3zqksjIxpm0cwBhP4Jtv4NqkFy6//G3vwyJpVwvi2U15N7CZBtJppiAu5rx+ zLvyTpXv5Ey4SrOfq22A+yT/ybX7mx5e6XqIpgi++Bffp1U+72yv6lmEFwOhLQKENg7e k+UiDrTNj24lY0l2FgZhHfpoP/sDkMng6Th/lZilXHPYYHQLmO6NtOSRahiKi/nugeWj fjJcFfg1iI8oe/glKmhxEIXl6xvP852dDZ0aNotqCGyZsvtuZJfTJLMt7Q1yrl8jO3lI CPyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682683078; x=1685275078; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HsX+f2IVkrgIdegQ6uKKgRhQWYSnAO+rZAXPTc6eFzQ=; b=kV10pCaT4kI332n5y1p38+7TfDC+r5gYJ0iSAW5aFQk8pMltRf7ixop11XyF3IY/Rf rNiY4VV8RmI919ReKP3CY9uAXpzC+VczTxIWSfjY6ai88LKkxW2y6EXR5ehUYC1zAlyR 9R9Tow1Sywi9TyGuv2RDkO+TbVE3BE6EIIWEZ31R2TI410IFyDwT/XBWhiFRiLUmY+su AwimogGFpIDP7DLEUbcahKkEbaTm2BXSlvMneO3KpqRgVxk/jjXmr/VcTe+o8At40VpQ McZKbALnTPwQC0N7lwLMiq9cImJ/hTLL1E+OHTF8klhLHJNyFC3f25i/lWKnC3bWdgot sdtw== X-Gm-Message-State: AC+VfDyr18IUA5YPpGwa7DbPpsUMruSTWcan33ZINr3k9DxcmmBekl/e 6dE3iBBfU3wCw3i7PkuhcY/lZA== X-Received: by 2002:a7b:c5c6:0:b0:3f1:9acf:8682 with SMTP id n6-20020a7bc5c6000000b003f19acf8682mr3483951wmk.17.1682683078081; Fri, 28 Apr 2023 04:57:58 -0700 (PDT) Received: from airbuntu ([104.132.45.110]) by smtp.gmail.com with ESMTPSA id y32-20020a05600c342000b003f173956a82sm27332528wmp.21.2023.04.28.04.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 04:57:57 -0700 (PDT) Date: Fri, 28 Apr 2023 12:57:55 +0100 From: Qais Yousef To: David Dai Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Qais Yousef , Quentin Perret , Saravana Kannan , kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1] sched/uclamp: Introduce SCHED_FLAG_RESET_UCLAMP_ON_FORK flag Message-ID: <20230428115755.7uklfd4fmpoee4dp@airbuntu> References: <20230416213406.2966521-1-davidai@google.com> <20230419175414.ycnlaperdkjxgypx@airbuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230419175414.ycnlaperdkjxgypx@airbuntu> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 04/19/23 18:54, Qais Yousef wrote: [...] > I was considering to have something a bit more generic that allows selecting > which attributes to reset. > > For example a syscall with SCHED_FLAG_RESET_ON_FORK_SEL combined with > SCHED_FLAG_UCLAMP_MIN/MAX will only reset those. This should make it extensible > if we have other similar use cases in the future. The downside it *might* > require to be done in a separate syscall to the one that sets these parameter. > But it should be done once. > > Maybe there's a better interface, but I think it makes sense to do it in a way > that we won't have to do this again. Would be good to hear from maintainers > first before you take my word for it ;-) Actually I think we can do a better and simpler generic interface. We don't need a new flag. We can just add a new parameter for what to reset on fork. When this value is 0 (which it should be by default), it means reset everything. // pseudo code #define RESET_ON_FORK_ALL 0 #define RESET_ON_FORK_POLICY BIT(1) // implies resetting priority #define RESET_ON_FORK_PRIORITY BIT(2) #define RESET_ON_FORK_UCLAMP BIT(3) struct sched_attr { ... __u64 sched_reset_on_fork_flags; }; Cheers -- Qais Yousef