From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CE3CC433F5 for ; Fri, 11 Mar 2022 08:35:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 928778D0002; Fri, 11 Mar 2022 03:35:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B1C78D0001; Fri, 11 Mar 2022 03:35:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7524C8D0002; Fri, 11 Mar 2022 03:35:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 625168D0001 for ; Fri, 11 Mar 2022 03:35:54 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0FACC8249980 for ; Fri, 11 Mar 2022 08:35:54 +0000 (UTC) X-FDA: 79231447428.18.194B629 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 6A232100018 for ; Fri, 11 Mar 2022 08:35:53 +0000 (UTC) Date: Fri, 11 Mar 2022 09:35:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646987751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=09zv/YWqFmnjIad7bvkoBTRQjQofFPvijtp9CNjGK5g=; b=d5iJPaGnk8plhhGqLLUoqJ4w0i9Ja4ZTOiPnood3+vXz+tQM2+MJY1WToDvL/qzHycFaSh Eq9i0dYaAh1Ft81IOU3+lLrkwu6jbWNtSIVE8y2S1C2TuhBNiirkmY/MICwQTER5TXSgYv TlTbdr4QVwa0KH7gtGiQQBVavpdf7kfBNDVJsbEGS9pupdfZiKgXty2aU903IMCTsi+HP4 r+cVtQwHnkAb4W2ywGIAwfbRMsTrCWaixVhJWk0exMbR68p+KyrMDZQ/umbC80GmqwMbk8 vmVcCyG9tQOenxwelL6T0jfk/sPNkUvBC2st1ImTzBZ+DcLiSWtuE83ZVaVArw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646987751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=09zv/YWqFmnjIad7bvkoBTRQjQofFPvijtp9CNjGK5g=; b=lMU2R1KI6O6Y97Z5G2ihSkHYEvM8XSW82A9fhyOz4RCLWmuOEddNSo0OvBAgR6Hm4t6X78 64kHuJGzqk2mKSBQ== From: Sebastian Andrzej Siewior To: Andrew Morton Cc: Marcelo Tosatti , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Matthew Wilcox , Mel Gorman , Nicolas Saenz Julienne , Juri Lelli , Thomas Gleixner , "Paul E. McKenney" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Daniel Bristot de Oliveira Subject: Re: [patch v5] mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu Message-ID: References: <20220304163554.8872fe5d5a9d634f7a2884f5@linux-foundation.org> <20220310182326.5b375da6b86e95f7e71acd90@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220310182326.5b375da6b86e95f7e71acd90@linux-foundation.org> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6A232100018 X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=d5iJPaGn; dkim=pass header.d=linutronix.de header.s=2020e header.b=lMU2R1KI; spf=pass (imf14.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-Stat-Signature: k5ckw87y1pxcja6g3ahd4561yjgjromn X-HE-Tag: 1646987753-268474 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: + sched division On 2022-03-10 18:23:26 [-0800], Andrew Morton wrote: > On Thu, 10 Mar 2022 10:22:12 -0300 Marcelo Tosatti = wrote: > > On systems that run FIFO:1 applications that busy loop, > > any SCHED_OTHER task that attempts to execute > > on such a CPU (such as work threads) will not > > be scheduled, which leads to system hangs. =E2=80=A6 >=20 > Permitting a realtime thread to hang the entire system warrants a > -stable backport, I think. That's just rude. I'm not sure if someone is not willingly breaking the system. Based on my experience, a thread with an elevated priority (that FIFO, RR or DL) should not hog the CPU. A normal user (!root && !CAP_SYS_NICE) can't increase the priority of the task. To avoid a system hangup there is sched_rt_runtime_us which ensures that all RT threads are throttled once the RT class exceed a certain amount of runtime. This has been relaxed a little on systems with more CPUs so that the RT runtime can be shared but this sharing (RT_RUNTIME_SHARE) has been disabled by default a while ago. That safe switch (sched_rt_runtime_us) can be disabled and is usually disabled on RT system since the RT tasks usually run longer especially in corner cases. People often isolate CPUs and have busy-loop tasks running with SCHED_OTHER given that there is nothing else going on there will be no preemption. In this case, the worker would preempt the task. In this scenario I _can_ understand that one wants to avoid that preemption and try things differently like this patch suggests. We can even offload RCU thread from isolated CPUs. But I wouldn't say this requires a backport because there is way for a RT thread, that claims 100% of the CPU, to break the system. Sebastian