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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC669C4338F for ; Mon, 23 Aug 2021 16:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D66E660F21 for ; Mon, 23 Aug 2021 16:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbhHWQhC (ORCPT ); Mon, 23 Aug 2021 12:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20674 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbhHWQg7 (ORCPT ); Mon, 23 Aug 2021 12:36:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629736576; 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=r5NSirjKs41jSzfQIVFQxmbd80RcTLP1GCVAVajYdQQ=; b=XTgqkyTpujdIAXbpkq7R1fisD6nmzfsgTXBhIfVW4VQez53n9C6A26tuoGrAG2ps5NLozp o8TEAnjworg6/WNPrPS5iICxV3vy4gDe4mvReoDiUuPK5u/Vwye+jwYYmqiEbo2IOH5nXq PK1SpBxswoTJlxVqI1+zYYa5Dt4ChJQ= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-mmlEAJ_1NdO-6pFBKUYQuw-1; Mon, 23 Aug 2021 12:36:13 -0400 X-MC-Unique: mmlEAJ_1NdO-6pFBKUYQuw-1 Received: by mail-il1-f199.google.com with SMTP id c16-20020a92cf500000b02902243aec7e27so10104095ilr.22 for ; Mon, 23 Aug 2021 09:36:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=r5NSirjKs41jSzfQIVFQxmbd80RcTLP1GCVAVajYdQQ=; b=s9Cu05PvAogjZa6ywFV8xS7Tm+e47y1jUrCPjxHbfx143Hxcrs9boj8V49bfOYVmfq X5t/jtz6j2aqVxr+kvQTQLi5XnTEKOPUkOQgrUnV7uni4VZDDSFsJK4sxJ4q3juEiXBF 3NyxsMelELArtwmpd/I1gOkwofJVfyokl6mqF5Obr3LPDtRA4IpfB1ZckZqGUraDW+Yf a06wc657FRQcQTKZszmm0zcAIFc5F5VE+R/HSHV/B7Xzwzc3WFpXmGxGIJ82983vo9qf vT8b/r9WkHAXTcFp+243QthjuI0KbC0vMFid475wLXGe4Axwvki1Dx4NmX8LZ9mLTUPW Vv3Q== X-Gm-Message-State: AOAM533U1dWRvIBv7pxPNOBjlX3mVUK2pCHWPgSdrbsmRPeVk4U7BZ98 kzpBGoCyUcYQItxwksILZMtyGuGlq9sOn9Kw/gnSFIJZKXbpmd5zteHBRZhqfFbwov8+jaBDxQM xFQIxVT9wIIyFo2jZaja0/XqK X-Received: by 2002:a05:6602:341:: with SMTP id w1mr27131480iou.40.1629736572394; Mon, 23 Aug 2021 09:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjIF/CeJPjrbLMOMSAillsWB3d7qGWogCMb9ncBdT7T+8wQDkqYOC3c+S2kxOZsak+rrto5w== X-Received: by 2002:a05:6602:341:: with SMTP id w1mr27131468iou.40.1629736572248; Mon, 23 Aug 2021 09:36:12 -0700 (PDT) Received: from [172.16.0.19] (209-212-39-192.brainerd.net. [209.212.39.192]) by smtp.gmail.com with ESMTPSA id z6sm7453260ilp.9.2021.08.23.09.36.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Aug 2021 09:36:11 -0700 (PDT) Subject: Re: [Cluster-devel] [PATCH v6 10/19] gfs2: Introduce flag for glock holder auto-demotion To: Matthew Wilcox , Andreas Gruenbacher Cc: Steven Whitehouse , Linus Torvalds , Alexander Viro , Christoph Hellwig , "Darrick J. Wong" , Jan Kara , LKML , cluster-devel , linux-fsdevel , ocfs2-devel@oss.oracle.com References: <20210819194102.1491495-1-agruenba@redhat.com> <20210819194102.1491495-11-agruenba@redhat.com> <5e8a20a8d45043e88013c6004636eae5dadc9be3.camel@redhat.com> <8e2ab23b93c96248b7c253dc3ea2007f5244adee.camel@redhat.com> From: Bob Peterson Message-ID: <43cf01f7-1fb5-26a9-bcda-5c9748c6f32e@redhat.com> Date: Mon, 23 Aug 2021 11:36:10 -0500 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/23/21 11:05 AM, Matthew Wilcox wrote: > On Mon, Aug 23, 2021 at 05:18:12PM +0200, Andreas Gruenbacher wrote: >> On Mon, Aug 23, 2021 at 10:14 AM Steven Whitehouse wrote: >>> If the goal here is just to allow the glock to be held for a longer >>> period of time, but with occasional interruptions to prevent >>> starvation, then we have a potential model for this. There is >>> cond_resched_lock() which does this for spin locks. >> >> This isn't an appropriate model for what I'm trying to achieve here. >> In the cond_resched case, we know at the time of the cond_resched call >> whether or not we want to schedule. If we do, we want to drop the spin >> lock, schedule, and then re-acquire the spin lock. In the case we're >> looking at here, we want to fault in user pages. There is no way of >> knowing beforehand if the glock we're currently holding will have to >> be dropped to achieve that. In fact, it will almost never have to be >> dropped. But if it does, we need to drop it straight away to allow the >> conflicting locking request to succeed. > > It occurs to me that this is similar to the wound/wait mutexes > (include/linux/ww_mutex.h & Documentation/locking/ww-mutex-design.rst). > You want to mark the glock as woundable before faulting, and then discover > if it was wounded after faulting. Maybe sharing this terminology will > aid in understanding? > Hmm. Woundable. I like it. Andreas and I argued about the terminology but we never found a middle-ground. Perhaps this is it. Thanks, Matthew. Regards, Bob Peterson