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 EB56EC4332F for ; Thu, 9 Nov 2023 09:39:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F5D680030; Thu, 9 Nov 2023 04:39:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A50D8D0073; Thu, 9 Nov 2023 04:39:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3948D80030; Thu, 9 Nov 2023 04:39:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2B5608D0073 for ; Thu, 9 Nov 2023 04:39:52 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id EBD0B1A0DCC for ; Thu, 9 Nov 2023 09:39:51 +0000 (UTC) X-FDA: 81437918982.23.2D7F5A3 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by imf02.hostedemail.com (Postfix) with ESMTP id 1A58480017 for ; Thu, 9 Nov 2023 09:39:47 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of david.laight@aculab.com designates 185.58.86.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com; dmarc=pass (policy=none) header.from=aculab.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699522789; h=from:from:sender: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=JN9V3H+uE1nEdApx+PoH16Ooij+kOYxH5XDU8X1poyE=; b=yO2Mzfpqn7tok7tMHjZhccrSC5NJeKNiFHv9rhC8sSfySlSSbUInR5sTK6Ew7o7MFfUH91 dfCOP1Xb8JCj9xaCMNa2DjpyRnaQZlEg9IGkGR0THxCCjIlHgLcDRy44rbIrmPNQZVQh1G SMK85yhXcFe+RNp3KfOFG65oLXpDu3E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699522789; a=rsa-sha256; cv=none; b=z1S3q/Jgz7bMtJOT/fL7oC8urmjOKAZKfU7RZOqGEusRLSrLNIQhu74co8I8GcN39HZEvL P6WDW+kikBxUmDLiTD+EkmwVmHKC52uGJX/Atm4T1H0pE3fqKUQwedzc/JBe4J3OcChn2K yPGGl3XWi+wGBzJODY0YwwhBb1Ah6k8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of david.laight@aculab.com designates 185.58.86.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com; dmarc=pass (policy=none) header.from=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-311-kWHIacAcNKmgzdDrFlUTzQ-1; Thu, 09 Nov 2023 09:39:43 +0000 X-MC-Unique: kWHIacAcNKmgzdDrFlUTzQ-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 9 Nov 2023 09:39:33 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 9 Nov 2023 09:39:33 +0000 From: David Laight To: 'Steven Rostedt' , Kees Cook CC: Ankur Arora , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "peterz@infradead.org" , "torvalds@linux-foundation.org" , "paulmck@kernel.org" , "linux-mm@kvack.org" , "x86@kernel.org" , "akpm@linux-foundation.org" , "luto@kernel.org" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "mingo@redhat.com" , "juri.lelli@redhat.com" , "vincent.guittot@linaro.org" , "willy@infradead.org" , "mgorman@suse.de" , "jon.grimm@amd.com" , "bharata@amd.com" , "raghavendra.kt@amd.com" , "boris.ostrovsky@oracle.com" , "konrad.wilk@oracle.com" , "jgross@suse.com" , "andrew.cooper3@citrix.com" , "mingo@kernel.org" , "bristot@kernel.org" , "mathieu.desnoyers@efficios.com" , "geert@linux-m68k.org" , "glaubitz@physik.fu-berlin.de" , "anton.ivanov@cambridgegreys.com" , "mattst88@gmail.com" , "krypton@ulrich-teichert.org" , "richard@nod.at" , "mjguzik@gmail.com" , Herbert Xu , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Thomas Graf Subject: RE: [RFC PATCH 71/86] treewide: lib: remove cond_resched() Thread-Topic: [RFC PATCH 71/86] treewide: lib: remove cond_resched() Thread-Index: AQHaEnua2nCaMITSyEySoaHbkNrcGbBxukcg Date: Thu, 9 Nov 2023 09:39:33 +0000 Message-ID: <3ad1798407144171b3e82e90d6b0565c@AcuMS.aculab.com> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> <20231107230822.371443-1-ankur.a.arora@oracle.com> <20231107230822.371443-15-ankur.a.arora@oracle.com> <202311081114.0F15C1FB9@keescook> <20231108144144.3d257286@gandalf.local.home> In-Reply-To: <20231108144144.3d257286@gandalf.local.home> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 1A58480017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: wjzkkem94n6nzrd99re9fdr73bdhpuny X-HE-Tag: 1699522787-726469 X-HE-Meta: U2FsdGVkX18fVLicnlTqfolpsgp658AfDtThpsF4TTV/PXts/2QZ7x+o9VBfy+sRxKCLJRbnF9K9V9vkltbneBPmsV/BwuZ+PhMpDD8t1/OF8yiQ7PvqlubYAmlLeYOSshdghXvrDdLUjgFhbCXUKBAqLA10/JccG2d+YaoLmVjmd+uYCUpF0S7q6blRV8ptjHuE29dJnbemKYb/nRQCSByNfKEpi9vq8bcsBAeUifK2xXDRRvwqYsBb0dPMDsCRA+Wc9fvwwhMNEvBuU49OCSU/FjHHZ3QciFVW0F/IGDF+1z87biditANcDpfGJ+l9YL/MC19kyIZ/8pJN46hqWdOjJJaBjBqbi8thHacfL1EHWR1lf5YbXWS6WwWEi2OZG2l66wYINQGX6530GYFI6yKR3ep3KHPiepevQxqQFkICo7ISjY+Kov+UogruA0PSv694+vjXxLYAL9E2SpZsVPlQpKSimBszttsk5N+35hemFeZUQEW6ieeVI2PICPDPyNW/ok8/PQehraihZSbX7gbyfM4zBWtioKDTKETie8a8y8G6O1b7pXdBMdPCacWaGZjMucu5w1GvZCPZUBm5jA61hQ/VbauaxGl+ARjOBsI7yOCXtFHD/l9TtffsWvXjTleSLpIC6zMuMJG/liya1DUWMyMJUtRRH/Om/dy5LMJxcSNWwjDJj074rlvX0+VOQREoGkw+aiFOhqORFu/xjhyp0hFhfUZQPTzgvoLkzB7sr03VPZCvzTsjLnHWGBFOwAth7Vne/GdeaxIqSNeDrzO3q2svKLRMUBBfS5hfCzFoxG0X7WyDLkRpSOpLUiFl1YshFdmd2gF3RvPTEHVP5ZfXaJqP4/c5wNcgk4S3+V9n6Nkx9aL+CeAtbxNEJFiQ7JEco5u9X8lZLP4+veWBBaty21kDSOL7E8x0/O328NQFWamh4JMNOehmtGQyysL1XeNc0jSzQNkIbcgorQo MRvyf7/A zoDd5zjhXio1zo+u+Q1G45OXTUCxb/yPOVz/xzWtKPIfVWULaNKat1OTDvhvc2QMn8QGU7fhIF8DD8Q/4hn0RSm2ZpvUnELdPdKFv8yfdMSloaLnw2Kw/u6VX7MjfiapQoA4fryPzWuRL1N3MLelHZVONJh2hgW/KPkzixnbGi/s2fR1n9Hz2Fpln7aLRvHOWOprHsSGSKmCJHIiK1HjGzC66h13ls7CVoA8r9w7zqjz09a1Pw78Czddv46T00McCfyBr3jtarntfcrAbhkIgpNnjKZtqm9EkQoikyZmEeos9ofvqPTOSGbori+tmuPdvAqAnnYtRWbyrPjw8DzHaZoxqOw== 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: List-Subscribe: List-Unsubscribe: From: Steven Rostedt > Sent: 08 November 2023 19:42 >=20 > On Wed, 8 Nov 2023 11:15:37 -0800 > Kees Cook wrote: >=20 > > FOr the memcpy_kunit.c cases, I don't think there are preemption > > locations in its loops. Perhaps I'm misunderstanding something? Why wil= l > > the memcpy test no longer produce softlockup splats? >=20 > This patchset will switch over to a NEED_RESCHED_LAZY routine, so that > VOLUNTARY and NONE preemption models will be forced to preempt if its in > the kernel for too long. >=20 > Time slice is over: set NEED_RESCHED_LAZY >=20 > For VOLUNTARY and NONE, NEED_RESCHED_LAZY will not preempt the kernel (bu= t > will preempt user space). >=20 > If in the kernel for over 1 tick (1ms for 1000Hz, 4ms for 250Hz, etc), > if NEED_RESCHED_LAZY is still set after one tick, then set NEED_RESCHED. Delaying the reschedule that long seems like a regression. I'm sure a lot of the cond_resched() calls were added to cause pre-emption much earlier than 1 tick. I doubt the distibutions will change from VOLUTARY any time soon. So that is what most people will be using. =09David. >=20 > NEED_RESCHED will now schedule in the kernel once it is able to regardles= s > of preemption model. (PREEMPT_NONE will now use preempt_disable()). >=20 > This allows us to get rid of all cond_resched()s throughout the kernel as > this will be the new mechanism to keep from running inside the kernel for > too long. The watchdog is always longer than one tick. >=20 > -- Steve - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)