Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2988148pxy; Mon, 3 May 2021 12:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS7kDHCtqwF2x1yLEryEYdo3r2+t/9taU63HbHvRWDdArvtpQrKOykdD+ocSMp/Hp/OgsJ X-Received: by 2002:a17:906:f42:: with SMTP id h2mr18544471ejj.317.1620069789677; Mon, 03 May 2021 12:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620069789; cv=none; d=google.com; s=arc-20160816; b=mkg1aWcPjTETBR8w6g/0knrsaVZ+7sc0hmJx7ynnYM0Bd56gdzGh+Yb8KJeo+98pPm 7GyOKhh1jQK5VhSx0L/q19Wht5AIgn2HqpOiP4yhSWskkMDw4DqhlAFvmbMJbJOjqrlL 7AcMsGxj8BydFsZogisCTUJXG/uxmgXnhPzG9mIoNrlXpTNmSHIuMnStn+5C7Q5lBoPm fD9XSMvnZNOk/jAg2hh3QEHKNT3otPeHFcCdS7DrCEwhQfkNCGRXSpsmQmVvQoLAOZ9O +WAnLtTM1yL3prgIhxOL7Cdm8UGesUpOMBlunSWGWyDkxg8uKJwKiUJIX8Wxt+3TSq+x mfsg== 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=lE2vP08X6IJ3m7govexvoLdskHFUlMsx3rR6kOZ0Tfg=; b=x2ZlRsqSPxNTZ1z+xkp+AZeec0+G4g/zZU6b5J5SaUiPdIVTUn3lVnLy597B0blW/i KR/EwhiSJPbdhnNUyx5AzgKggCLs75tRXvuoFEV7OxzTrlO/vLcVsVWdpsF8GzK4m6K2 iR+mkiPaKQDT/+aMdjQZCZ6+zF3rVK031Wj7tw6ec2R3/mt6vZIaA82EOxDVfo+Mwjvz eyuUxLyLu1arymhO/vnaV4t5wxwPJWHKx+JL/6muibRI97qtrj1Mvmgu7Ste82AO/bL3 QPA9s6V/OgPbsxznOJX/TsW/K4xd1/tojRgf2kZx4mttRv/7TcCpMA4zEgYNbtN5/qJL uhtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SdMZLKMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg8si712945ejb.592.2021.05.03.12.22.46; Mon, 03 May 2021 12:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SdMZLKMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbhECTUZ (ORCPT + 99 others); Mon, 3 May 2021 15:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbhECTUY (ORCPT ); Mon, 3 May 2021 15:20:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6509DC06174A for ; Mon, 3 May 2021 12:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lE2vP08X6IJ3m7govexvoLdskHFUlMsx3rR6kOZ0Tfg=; b=SdMZLKMbVy0LaukGsj38wZsqVb ksvJLzM7y2/LZaaUtzyrvrn89lxgo7QJwLgel6JGjRGupHGVaW/agE9uQ5tVh3o7aP09Tz7H/dwio KH3A2BUcOCkwuq9O1c3m3FuwSgWGtSl9o/BPJ5y+bVZqA7RCiFkFsHG1DFmzamPO5J9gGjwKhZRmm HgJpaM8pU5k7GjQkDBH6kLBJqmpJKCyUapl+q6xthWT16/JICvlIchHnk00y5hw+SFjgHb/TTLzvO jSVMfTH0Z5a7dMSdIERIebnwiMDZY2+jY0qnMKOeyhfPHE78B2cRteUaMN7TW32RV36ymkdykOaHl G1x7rElw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lde4F-00FWTA-5q; Mon, 03 May 2021 19:17:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9E9D6300036; Mon, 3 May 2021 21:17:17 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 776B42C1AA720; Mon, 3 May 2021 21:17:17 +0200 (CEST) Date: Mon, 3 May 2021 21:17:17 +0200 From: Peter Zijlstra To: Josh Don Cc: Joel Fernandes , "Hyser,Chris" , Ingo Molnar , Vincent Guittot , Valentin Schneider , Mel Gorman , linux-kernel , Thomas Gleixner , Don Hiatt Subject: Re: [PATCH 04/19] sched: Prepare for Core-wide rq->lock Message-ID: References: <20210422120459.447350175@infradead.org> <20210422123308.196692074@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 29, 2021 at 01:11:54PM -0700, Josh Don wrote: > On Wed, Apr 28, 2021 at 2:13 AM Peter Zijlstra wrote: > > > > On Tue, Apr 27, 2021 at 04:30:02PM -0700, Josh Don wrote: > > > > > Also, did you mean to have a preempt_enable_no_resched() rather than > > > prempt_enable() in raw_spin_rq_trylock? > > > > No, trylock really needs to be preempt_enable(), because it can have > > failed, at which point it will not have incremented the preemption count > > and our decrement can hit 0, at which point we really should reschedule. > > Ah yes, makes sense. Did you want to use preempt_enable_no_resched() > at all then? No chance of preempt_count() being 1 at the point of > enable, as you comment below. preempt_enable_no_resched() avoids the branch which we know we'll never take. It generates slightly saner code. It's not much, but every little bit helps, right? ;-) > > ( I'm suffering a cold and am really quite slow atm ) > > No worries, hope it's a mild one. It's not the super popular one from '19, and the family seems to be mostly recovered again, so all's well. > > How's this then? > > Looks good to me (other than the synchronize_sched()->synchronize_rcu()). > > For these locking patches, > Reviewed-by: Josh Don Thanks!, I'll go fold them into the proper place and update the repo.