Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2002261pxb; Mon, 23 Aug 2021 09:38:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIwbSTVTtgiJxkulA6jNMCaqeehpmcwqbKseP6LW96wWI5lZ6BQMZP8AHVszWvrXWf0vK7 X-Received: by 2002:a05:6638:13d6:: with SMTP id i22mr30303997jaj.13.1629736704632; Mon, 23 Aug 2021 09:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629736704; cv=none; d=google.com; s=arc-20160816; b=Us4ttHJ3LLfn7yVzSLWDacO1wykh6j1p+l4VvBgd8+64iMHezKuN/ltRXBHGB8xnIH +xEMjS2VMJvjKRcszWBSa9JpL8Q6G4SS9NpILuxCUlSVl79g1eBYg+uYBKnBveW/V9BG Bal8aB5vsgwqTtqimt5hL0B7DjxGSLlBEyW/B4U364QPASaa94+2EfzMamqJth1/z3fu pvz/U50MPvnc577zzC7TnZdMzlhSrqBGc5zxRjLXrLtc5+Ex83LBr2nLx5bVPC7dhnuf 37mFZid1wBTUeKCK75x5cL5Pt+DUrfcs0w78WTQk/LE4kI9hHcZiK1Yir4G9p2EoMDey dGgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=r5NSirjKs41jSzfQIVFQxmbd80RcTLP1GCVAVajYdQQ=; b=O7TZixp8e0rAZ12MlRdIgTNdyw/TlQ9uHlHdyC0LhGXjizNJWDCRR2F8AHkgJ/4hXY m5iajGVxZX5tTG0aQYddMTnwW7TahW4RFkwfUQ/lEfH38HCVeLvN330I5JWnwcB3IWCC yWthJgvtnEv9zrFIFcV0GXNwhkCuU134k2oa1YSkF8YjODg+8JNFg9/GUk5YXYG8MG+8 j85lrUtPVJ185j+EW+SiQ3ql81Vv9B/+tgA6G3bM3iS4B6hCpFfaWGcpWNRf3M7Gfs3H 1cbDgo1FTcsgP6h1XvSvCrhRhlRKv4a2QxI3kaMn58K7LHYbVOzkgDl1dMCxE437PTNT hXUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XTgqkyTp; 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 p133si12718311jap.27.2021.08.23.09.38.13; Mon, 23 Aug 2021 09:38:24 -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=XTgqkyTp; 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 S230162AbhHWQhB (ORCPT + 99 others); Mon, 23 Aug 2021 12:37:01 -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-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