Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3346948pxb; Sun, 26 Sep 2021 12:17:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfxssVL9LLyZTdPuwOGfvv0qZu8JURefq4DJLQfydaZJiUiq/NCOucXM1b1dtJRIs/1CF2 X-Received: by 2002:a17:902:7783:b0:13d:fee6:8095 with SMTP id o3-20020a170902778300b0013dfee68095mr9335080pll.7.1632683873145; Sun, 26 Sep 2021 12:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632683873; cv=none; d=google.com; s=arc-20160816; b=vndr6OVTg519xYXdh4UZwCl9Y+0zUwj7ymeWye8+J4kKMqh9eq9KNu7hDLK2cwrDhU 9G9Kq1YHosJiPMHrGXk0APdiFmR+4k0K5N5zK4LNqYERAbxdjbQXP+fZsOEbdNrSsDU5 ryq46HkFPJTGRdOEOpbPnIJ3PVRaO44l8Vmrj6Jd/woS7FD1fZUwXFRuTpVhi8QSTcNJ Vqcqy0KjmVcEhDm9WpQs6WKWYioA1CRC3IA+jFMQlfC4g1L/UFMHb+ISiEEwLCdMBflD aGUkRJVLn5Pz3/jR0sAZDVyMbSc9Tajth26M7UzNxPKEuD5ymOGzcXW9zuBM3oknG8j/ 1T/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=fiTE1F7WDvdOgznkiwGoN92jbdxh+8nMGfk4Hrr1+Bc=; b=otj2LFwQ1oZbw2J2R3nGTeT85NIxxMtmyUnUf6lkWIeLQBPJ1KRjFzyUMxbj/IjYPO 6tz+SY4TqR2MBsEiQIgVtlvLBQ0Omx/wI8YI59C+PknES2MAvlEtjcUfEoFG4samKmuW RvPjPv/HmZl9hBx20JAPdkploifAW912qLhBHvOvTBrePZZvcnxzpAQIiyGrI8EwA7gu XmI+Grg+UaUYzTKgOR/ztwcdh+KNdVkJwFZk3AqwhbtN3XneoShI8fSBfbsRTwxy4zRw Kvc0XtneMDfdgjQd8m69GyVPkEfyOetNIGIeI8unEXd1pahgpgvLcUzTjJISo2so1z/R 0QAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RsiNkSso; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si19242961pgh.182.2021.09.26.12.17.39; Sun, 26 Sep 2021 12:17:53 -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=@redhat.com header.s=mimecast20190719 header.b=RsiNkSso; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbhIZTSb (ORCPT + 99 others); Sun, 26 Sep 2021 15:18:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47826 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhIZTSa (ORCPT ); Sun, 26 Sep 2021 15:18:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632683812; 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=fiTE1F7WDvdOgznkiwGoN92jbdxh+8nMGfk4Hrr1+Bc=; b=RsiNkSsosTpvCMx0208qSVnAL0vaovhuldKshgvXhRL/QaOETzadDvy8x0Ab+rbBJBbYzf s/15B4BLzug9WdLy+BNTK7uRH7sXqT3etlSYUkpCb5Kdqkhuho9wR/pXdwp/wSTXJz4mnq RRA9Bgl7UHfLmScJlETcD45hOzp4a+8= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-KMEBche1OhurnYTWw9dKvw-1; Sun, 26 Sep 2021 15:16:51 -0400 X-MC-Unique: KMEBche1OhurnYTWw9dKvw-1 Received: by mail-qt1-f197.google.com with SMTP id c21-20020ac85195000000b002a540bbf1caso58965211qtn.2 for ; Sun, 26 Sep 2021 12:16:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fiTE1F7WDvdOgznkiwGoN92jbdxh+8nMGfk4Hrr1+Bc=; b=UIinUNvGQfD78DWVOHk/muJuP2Sns8obwSUofbbTpbZoX6xzFH4ogV004Ov7L2pKgd vO6CXzDRlWVfky0veaWitXM0DeG+yqqIBiVDtnWdXA5zxNtroABgaBbj0yAKdGJA2l/r Dw4ojNKFvt/tBHYZa5lij9YJab970AGjZioH/BGPa9Y5+0yMG6n9VRw/vlZhGSLYTWAI YYh0tbPbbNRgL3EfU39ucyUBuUbhFbR2qHLjMetAgy8QEtZLGCmxg8N1wyS9wcpQxy78 zXkCvsp2i5cx1UY0XQTdGB77v8Xg9IZOBW4JgZHvvmaZOozqZNW0a4bK1qgC6QzXScqC eUrw== X-Gm-Message-State: AOAM5337LcDIKhaf2Y4NrUjDTPQ1bAJF71fITzGk11ckMfwdGP8czmpH I+lrEMBEF878IYyq4PZb7S3jKmPEsF6lRTbuLsCSmTsvExMYaSaBKaNAZIJjoklvDz4mIiMxLlz u4qOSY27WyijBNz57aw0wca32nJEpa+kOHK2IeIbqM6+dXKItztMYSyJSsaqsXrPKwAtSSH46 X-Received: by 2002:a05:620a:bd4:: with SMTP id s20mr20956108qki.485.1632683811043; Sun, 26 Sep 2021 12:16:51 -0700 (PDT) X-Received: by 2002:a05:620a:bd4:: with SMTP id s20mr20956089qki.485.1632683810807; Sun, 26 Sep 2021 12:16:50 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id k10sm4221492qkk.124.2021.09.26.12.16.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Sep 2021 12:16:50 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH 1/2] locking/mutex: remove rcu_read_lock/unlock as we already disabled preemption To: Yanfei Xu , peterz@infradead.org, mingo@redhat.com, will@kernel.org, boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org References: <20210926101624.2460704-1-yanfei.xu@windriver.com> Message-ID: <9569eee4-266f-d83b-2af6-194a1a8b165c@redhat.com> Date: Sun, 26 Sep 2021 15:16:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210926101624.2460704-1-yanfei.xu@windriver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/26/21 6:16 AM, Yanfei Xu wrote: > preempt_disable/enable() is equal to RCU read-side crital section, > and the mutex lock slowpath disable the preemption throughout the > entire slowpath. Let's remove the rcu_read_lock/unlock for saving > some cycles in hot codes. The description is wrong. Preemption is disabled only in the optimistic spinning code which is not the complete slowpath. Even though it may sound reasonable that disable preemption is likely to prevent reaching quiescent state, but I am not totally sure that will always be the case as there are different RCU favors. Cheers, Longman