Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp585707pxb; Fri, 15 Oct 2021 11:33:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaHQpZbVRW86c9uqSUwKh642WYIS+HxPF+Q/vrZvIAUpYEr97CBluJ/kw2R0EO4AIY7pKq X-Received: by 2002:a17:906:2b84:: with SMTP id m4mr9030825ejg.179.1634322839350; Fri, 15 Oct 2021 11:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634322839; cv=none; d=google.com; s=arc-20160816; b=zvWmeFeAdE+ibs6ABUl2CnNU2FdoVlgPYWIGaFjQG/3ZPJDQ3zvm+yyRz4mPT0+rSd GOZXYhg17MgsMkDy9ByiPQ5fQNLE7m7dVfXt4GAmK+YcAbG86A510yLffqUyCfZVb7Ad Ary6WpNQvfnod4sVB9p/rYmXT78pWoPSjObcXBNfqvElyGnvm9xEsWuM51gFV3u1R1uE OiHk9iZZVtog2qDgUGqDPoOsdR/+mzhR68ihilqz7BY+TbIuU70Q9VrbdN7yS5YSgfQA oSyg5774sOuYHoRW27nnkOrVDUYXOquljLtbzkP0Ag8Vfya3ZUSe0a96obx8N4z8ngOE CBQA== 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=vslPbRrk4h1A3X/DwAfvRfy4Qab+SeGx3d56Sg8BvDE=; b=PGYkUUpGYAc535bcM6G2G/kU027psXK5IZwemscL6abE6S5Hr+A/ofdqRsKevW+vNg M2gAjwfCzdjRc2p8K95LlY6WOje8zkOhXZKIhH7jIrhUHVrzI9Z/5QJZkXKYCaDtpFvp 71YAfsLAkxFhtYrAdIzX51w6/y0imK5WAXSQlNTQHcj9F0d+yhWpKh1CHsMuk8/UjR9B gojToUycHkvTIlliYEfnZs3d5/Lt3fMmBDuzTEzotmiDA+RAT0uA6TY0LrHpyKfBqLxM XnGc5UR//mySXfL6q3xtPMJDEHZ/lpAII/FXmWqF6uKlwpkKcjx0NYhHMfbUhLvs+dRu BJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=GXVadxGc; 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 y69si8556863ede.35.2021.10.15.11.33.35; Fri, 15 Oct 2021 11:33:59 -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=desiato.20200630 header.b=GXVadxGc; 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 S237878AbhJOKWo (ORCPT + 99 others); Fri, 15 Oct 2021 06:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhJOKWn (ORCPT ); Fri, 15 Oct 2021 06:22:43 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F761C061570 for ; Fri, 15 Oct 2021 03:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=vslPbRrk4h1A3X/DwAfvRfy4Qab+SeGx3d56Sg8BvDE=; b=GXVadxGcEZ2KlI9U/DOWnxXKsn SWKgLvNGqHWoDz6Q+0ka9MqKyP0AnEAd2/cDEG18YfBC8YqQMAnQpeAybXhuUAwQelMWOAZ9er9IA 1xpFh165GBy0osLDo8tDtDfAqGGLlSE6NIEAOC55D7Jpbn1cBL9+NArj2C9pvVO/sxjLW9517MDR7 UkgYBhVAKBwxyAjzBnt2toP1j+yx2/bckWTiF3ga6hdFHwRINLWCzFcBpLsCWaauThpG7DReTlD0X 2alRAoludIyYF0jofxP/erTe+ey8fPvty4oCwiCw6EaNdSruMf0dRWkj8tK95/D2yTC78GO2ildse y6uZmZKA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbKKF-009z7h-4P; Fri, 15 Oct 2021 10:20:31 +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 94021300288; Fri, 15 Oct 2021 12:20:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7608720AC5B6B; Fri, 15 Oct 2021 12:20:30 +0200 (CEST) Date: Fri, 15 Oct 2021 12:20:30 +0200 From: Peter Zijlstra To: Yanfei Xu Cc: mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] locking/rwsem: disable preemption for spinning region Message-ID: References: <20211013134154.1085649-1-yanfei.xu@windriver.com> <20211013134154.1085649-3-yanfei.xu@windriver.com> 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 Fri, Oct 15, 2021 at 12:13:59PM +0200, Peter Zijlstra wrote: > On Wed, Oct 13, 2021 at 09:41:53PM +0800, Yanfei Xu wrote: > > The spinning region rwsem_spin_on_owner() should not be preempted, > > however the rwsem_down_write_slowpath() invokes it and don't disable > > preemption. Fix it by adding a pair of preempt_disable/enable(). > > I'm thinking we should do this patch before #1, otherwise we have a > single patch window where we'll trigger the assertion, no? Anyway, I've stuck the lot (reordered) into my locking/core branch, lets see what the robots make of it ;-)