Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3724902ybv; Tue, 25 Feb 2020 06:18:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwLnsxQ8ydsBvp/7NAaTYDwhhopTNRM/O6cy6+444XTRHjeIR3Ssw6P+xS0L03VCUHY5xNf X-Received: by 2002:a05:6808:312:: with SMTP id i18mr3910723oie.44.1582640287125; Tue, 25 Feb 2020 06:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582640287; cv=none; d=google.com; s=arc-20160816; b=Tk5yG2x9e8ERfg/sFeHYIedUeX3wkRmwxxOS9cNyzbkTBBzFOVwoo+K/wrkG3p5JVI 95+4yJmRs2nNiFsGWkeJe+1jzJLvHLz0oD94t+k4PUajoVbDEzq2CtoZLIMJwSbhmcru QMfHzaQcDaECSeVp/IuNh45mSi0GXLtnmZLeKXfaOmLfRjmth+CMRj6zzyiwNK2PQ3NH lv8ynD7ilEhxJDSxjiFKVITu5je6I9EXyaIBUSyfZ3MEMbKb5KHeOYwZnp2ju7thsXHh RK1SLUtURxIS4UyFARX6N9QG4uejmq8lIBqWIz57D7DXGQcx1eAIK0UIc3xB004VMKwr aRhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jv5c5LXoG9g5yRO+OixJLRTnRGPRBiLVL4S6lEJwqPU=; b=WQ37H7M4FwCVVrzFQ0rxmrUHOY0t+GFvlod5xjXsv1KXiQpu4JrQH3u+/O12JeWdQy yBeX2J8RgVDZ6VWfRxQimu6YnABACu7QNEPpgQTfyy1lpiMl6BDzWgh8GTjGvZT8GPbV oIlQUzWgQb4x+BztcZJCbK027hIdQexZ0a2DDIrnk8tJyEKieglIOkSVugocvONVp1r9 60dyCscM8pjpHZfIx9nhnHPodEvRWmhyFwYOnE82EDgTQQVcJNvlxm4qZYiR3Bklo1iT l3nqW75Pg+cP0SjAAOgbJDfbXvGvOvLuDrQc60IInkDDV9oBNBNa8X9Et11p71TYyMSa uqOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Zo0jrRpi; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si6237313oix.100.2020.02.25.06.17.53; Tue, 25 Feb 2020 06:18:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Zo0jrRpi; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730533AbgBYORX (ORCPT + 99 others); Tue, 25 Feb 2020 09:17:23 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:47096 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730478AbgBYORX (ORCPT ); Tue, 25 Feb 2020 09:17:23 -0500 Received: by mail-il1-f193.google.com with SMTP id t17so1427210ilm.13 for ; Tue, 25 Feb 2020 06:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jv5c5LXoG9g5yRO+OixJLRTnRGPRBiLVL4S6lEJwqPU=; b=Zo0jrRpiiyUzkvYLsp1Q5GrZDcP5YdfYNgbW+SescRTA6MLU7acUT6CIBq1tTHeb6s 2VlvzyZEk13CHU224wkG5kKxn2tX2XYOWZrstHodhsTKe0/R3Hrz0/DxLert2NyjAr4V QZ3gMmPmFlOm45vjwhfanS8YzlV2cIN3mX+yY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jv5c5LXoG9g5yRO+OixJLRTnRGPRBiLVL4S6lEJwqPU=; b=d3obvc42x+KiV8HQigcClmdRSGrhh2hTAjMvpcWFdluf/THD8iA2lY+3t/IwvZvBR1 N9TGwb+jA9lO7cR9+TfGCWGaxXuqLMR0LcHWxLVDUXwpPIY9HsX2DnsEpBnffuvtW2Rs moZw2uu5hE7fz1/6c89Gb3uWjGxnGn4454OMiZH40NHWwxpfAq6/ETL0gLi4DeVgfavN T7Or7CLok8RvByMmX/ok5llGz2xJ27qWBqQXdoxERWAZApDGdlfhxX/Yf22d02cUE4Yv WDC8aCA10FHHvnIc/+eRBxVPsUREow3pMjsUsFhqAz66bXV3kMnKkdzWDmWJ+DK+JSg8 Z8kw== X-Gm-Message-State: APjAAAV8HqwF4MpvVgmMJlGU1BDGh6G24hIWsba1lWT8TnOcjQG9JUoe Qw46ogTIFlGen0O2AqfmN1reEo+95cY/oz18aqFmew== X-Received: by 2002:a92:5a59:: with SMTP id o86mr52888923ilb.171.1582640242301; Tue, 25 Feb 2020 06:17:22 -0800 (PST) MIME-Version: 1.0 References: <20200217193314.GA12604@mit.edu> <20200218170857.GA28774@pc636> <20200220045233.GC476845@mit.edu> <20200221003035.GC2935@paulmck-ThinkPad-P72> <20200221131455.GA4904@pc636> <20200221202250.GK2935@paulmck-ThinkPad-P72> <20200222222415.GC191380@google.com> <20200223011018.GB2935@paulmck-ThinkPad-P72> <20200224174030.GA22138@pc636> <20200225020705.GA253171@google.com> <20200225035549.GU2935@paulmck-ThinkPad-P72> In-Reply-To: <20200225035549.GU2935@paulmck-ThinkPad-P72> From: Joel Fernandes Date: Tue, 25 Feb 2020 09:17:11 -0500 Message-ID: Subject: Re: [PATCH RFC] ext4: fix potential race between online resizing and write operations To: "Paul E. McKenney" Cc: Uladzislau Rezki , "Theodore Y. Ts'o" , Ext4 Developers List , Suraj Jitindar Singh , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Feb 24, 2020 at 10:55 PM Paul E. McKenney wrote: [...] > > > As for "task_struct's rcu_read_lock_nesting". Will it be enough just > > > have a look at preempt_count of current process? If we have for example > > > nested rcu_read_locks: > > > > > > > > > rcu_read_lock() > > > rcu_read_lock() > > > rcu_read_lock() > > > > > > > > > the counter would be 3. > > > > No, because preempt_count is not incremented during rcu_read_lock(). RCU > > reader sections can be preempted, they just cannot goto sleep in a reader > > section (unless the kernel is RT). > > You are both right. > > Vlad is correct for CONFIG_PREEMPT=n and CONFIG_DEBUG_ATOMIC_SLEEP=y > and Joel is correct otherwise, give or take the possibility of other > late-breaking corner cases. ;-) Oh yes, but even for PREEMPT=n, rcu_read_lock() is just a NOOP for that configuration and doesn't really mess around with preempt_count if I recall :-D. (doesn't need to mess with preempt_count because being in kernel mode is non-preemptible for PREEMPT=n anyway). thanks, - Joel