From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0748B191F8C for ; Mon, 20 Jan 2025 07:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737358816; cv=none; b=qzlq+FZWqk7MjNSXlLwtmKvKKRTxm/C8nyeiTlWImsXxhzZ5PX+foRqa/rAaIJ8Trl71XwflqxFRnGL5sGO28Qh/uS+yCoPieeZqpVKFiHk1/yPNH+6ksx+6XMnjPV5VCS2MnY4tkpFDXVyZyweXITdOnEGubcLpuwxiiP5j9Qg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737358816; c=relaxed/simple; bh=RBnUaKYo81r/YED4eSRs6BUIgu+0lHrwzR3M0hmRK9E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZkLXQSdQ6kVKNPS4FHAZ+3UTV0W7KrV/FnllWO4NB9ApHu/MIiqXsv2MIFmKq0L8zRCNnoY/NxCzwrEcUG17iV3RgMIOjkON3wFwS4tvkkhQ0amF8BjM6icn5DRMGF78E07kMKA1IXnyoMF+bk0Up423NN7Tpge9k3sQW3NtIXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GLK4vWev; arc=none smtp.client-ip=209.85.214.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GLK4vWev" Received: by mail-pl1-f193.google.com with SMTP id d9443c01a7336-2163b0c09afso76243295ad.0 for ; Sun, 19 Jan 2025 23:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737358814; x=1737963614; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+dCaFvBsu81WDhEAttk1PSI/kz26bkP4F5Bn52pLU80=; b=GLK4vWevoSB3V6hzSpE/RZrwc/H6RpHGfoVyVR3gw7AZLyTDaw9fraoiYzvAfyDdCb ZNkU7/WtRS+jXOR0I+OqYinVn5T2p3MSbRMvF2QJc2fZCbl2IX/tqsfhtvCrerd2n+CQ 8/ntGxpGk/km1T/4wTMc5nQhaQMVe85uymkNHTaIaF0J9c6lTuRTJfBkgW/Oh4BcPUCa Cxow9W/IGnuTWsnVvZ9eSJxgb5KdJiV0MGGHi7qNnlwv6j/0PhsECADNz63BB0sSQopm LQXVfNep5n2lxxoaigD+GvnH7Z3VESfNOn5CaRPZwIpkVBPW32Ol/AJSjWSIuuDK213x 6nrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737358814; x=1737963614; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+dCaFvBsu81WDhEAttk1PSI/kz26bkP4F5Bn52pLU80=; b=CP3AzLVFR+xlEhPlxDyukW+rvLyYR8tP47nP0MvCAefj5zyjIFdHropCvLO59O9K9u m//6KozKWtgSI5IPcJpPkivKqI3/jgmgpnxWdl8TqR25Bgp9VeQo6ofqJJ6iuGQyghSb +C87HiduAUZwZnjJ7muS/uNoZr5W6XF3HrVpyzdqB6YBRPxJoTP/VpKf1rEyo/QczDT5 If2BbpnLQ24sSltNLRVZoU7rqPX3qQnrf2c/ioXWis3DfGLjtI6E/pAwWbeb0LLhuO1E 0+dOFHNEVwXi3/ZMmhn5UIMS78+GDZe7CIy6IOO13uIw+NdmYIloS9hOueFE12ImOe85 pCzw== X-Forwarded-Encrypted: i=1; AJvYcCXQKMS4HtahPEsqMHftoFTs2VMuf6EBRY6tLlml+bK9UATEt04Xh+9B74hck/30nUEhrcbRmwmnknuf2bU=@vger.kernel.org X-Gm-Message-State: AOJu0YyZi2Sg81UZ3egMb6aT1O5CpYml3KcMFBn7HkXbNIGmcPVkDbeV TTsqRldsSFKRl7BpgrlwxQ/yLsseuPxbJiMT19+PkS4425vsIJzA X-Gm-Gg: ASbGncsswE14DcrPtuBxuVeunJrCCW6A2M6PEAlC0sjQB9PI7y9kGm9S674rnwprZ8R V/iPRZKj17fXbFzZYjO6bAbzET7ZqvKVzpY1+IYIESHHBWbX7//AiFXxyUqr6EqYULSkv4A5ujZ AdPoMeYwsurtmdjMe3mXG98oOwErL3fvjuriC87k7doz5vi84mBOP67cZGHc6doPZyLrosBfPo0 1/SmyuzR1hDU4pMPWmY7asYvtaSifEKNptEA+ha6hPjhtJlQlEyi31CXMozTHkjVthOsj3vTLmh 2XHB0lC+u7D7xw== X-Google-Smtp-Source: AGHT+IE2Gj8AFZAd80Z8I92/kaHfCx5DM87SLeGrgHCYkL+uzNQR5Cd13AwhUdWVrW4cxoM1/PBR/Q== X-Received: by 2002:a17:903:2d2:b0:216:2804:a241 with SMTP id d9443c01a7336-21c355bc154mr178862105ad.37.1737358814085; Sun, 19 Jan 2025 23:40:14 -0800 (PST) Received: from localhost.localdomain ([114.67.205.189]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3d86e1sm55379145ad.172.2025.01.19.23.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jan 2025 23:40:13 -0800 (PST) From: zihan zhou <15645113830zzh@gmail.com> To: vincent.guittot@linaro.org Cc: 15645113830zzh@gmail.com, bsegall@google.com, dietmar.eggemann@arm.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, vschneid@redhat.com, yaowenchao@jd.com, yaozhenguo@jd.com Subject: Re: [PATCH V2] sched: Forward deadline for early tick Date: Mon, 20 Jan 2025 15:38:59 +0800 Message-Id: <20250120073857.47043-1-15645113830zzh@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Thanks for your reply! > For sure we should provide recommendation but I'm not sure it's worth > a warning but better a documentation for user who wants to set their > slice > Could you create a patch that only updates sysctl_sched_base_slice > and normalized_sysctl_sched_base_slice to 700000UL with figures and > explanation Thank you for your suggestion! Adding a warning is not worth it. I will submit a new patch soon, which changes the default value of slice and add the code comments about this change. I am not sure if I should change the files in the Documentation directory. If I should, I will move the content in the comments to the Documentation directory. > sysctl_sched_base_slice is updated by update_sysctl() for each cpu > hotplug so you can't really set it directly > > You can then try a 2nd patch which updates it with debugfs but I'm not > convince at all by this benefit because it should update the > normalized_sysctl_sched_base_slice which is really meaningless for > user There is indeed a big problem with this, and I overlooked it. Thank you for your corrections. I actually intended to add a numerical range requirement to slice through sched_base_slice_fops, because I noticed that syscalls has a range requirement (NSEC_PER_MSEC/10, NSEC_PER_MSEC*100) for modifying slice. However, it seems that the existence of this range is not important. > > diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c > > index ff0e5ab4e37c..d0f90d61398f 100644 > > --- a/kernel/sched/syscalls.c > > +++ b/kernel/sched/syscalls.c > > @@ -309,6 +309,10 @@ static void __setscheduler_params(struct task_struct *p, > > p->se.slice = clamp_t(u64, attr->sched_runtime, > > NSEC_PER_MSEC/10, /* HZ=1000 * 10 */ > > NSEC_PER_MSEC*100); /* HZ=100 / 10 */ > > + > > + if (p->se.slice % TICK_NSEC == 0) > > + pr_warn("It is not recommended to set the slice to an integer multiple of the tick\n"); > > You should better add documentation than a warning > > Also, this code has moved in fair.c now I'm a bit confused here. Has this code been moved from syscalls.c to fair.c file? I haven't seen this change on the master kernel. Is there any other code repository?