Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1793651ybg; Thu, 4 Jun 2020 20:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj00F8GgDs0mMWhJuPDE6FIH8u0ngRp0DI7SqVdUkwaoPLVMWMorMaLCf6+RV7XSCpQJZ2 X-Received: by 2002:a17:906:1116:: with SMTP id h22mr6562721eja.350.1591327534765; Thu, 04 Jun 2020 20:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591327534; cv=none; d=google.com; s=arc-20160816; b=STZRZWv855Tf++Ps/HBRtdzWavNBa3h5UlfoAwCWGJDCuOgbep4wYUk4xSOQfnVxpg NehWdj81V92ecKxtFne0IVIB/tCXClm+4U6ssCPDwjDf3VhXKKKYU62d7dBxNNqb2DE8 7jQLbsEgPzr/HnJcL2JIRNevWY/HYml/gqVX0I15tdv28PO7eYa7JKzwaakCkiFhSH5L RluTNAb6midojvi8v2cX1Pb8w7YFbWWm5Fwcohg56QwXC+4mndyqtezWcYFhX6jTa0mh nx8kdzvGLwQ8y1ZnH9k9Qj4APrWTNlL6ACpMX91fnHpbHsXo/QLK0RX/pEMvcot+LSJl pUgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=QyQw+sLIla93dlac0TERwcz4aWSKJuqSco16Wn/VCK0=; b=Q+CqwZVTVSDsmblVU61+v1TMCEDR9lToO+SmTX9xaIgI5UfDB+cWPVRgZRqRBsfzhx qcwG4/k6z/vYdNdm1lsFGxB5wiBsTgdyJcogYz72BXHdx+UUWa95R7apUHa/WI9ABMA2 x8KK0X5ZRJ3ld4hIdfpLOjoqUM1sRZdpy/trv9lfbegjy7z0ZAXrB5Uah7X85WoPelXQ akkjMKuYXDMhgB4jR0VllfYfooi7oah42L+dEZfSZbVpsS0ur2KXxOGirfHDWf7xouZc nCeqnlhTCho8/S4f+Pc2rX7E0LJ8uQ70oJrtX7i0W1YEAMnrA3pnxW8iTZ5H663mPFFF vp0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=oApTUVbv; 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 jr11si2817881ejb.602.2020.06.04.20.25.12; Thu, 04 Jun 2020 20:25:34 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=oApTUVbv; 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 S1726085AbgFEDW5 (ORCPT + 99 others); Thu, 4 Jun 2020 23:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbgFEDW5 (ORCPT ); Thu, 4 Jun 2020 23:22:57 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8251C08C5C0 for ; Thu, 4 Jun 2020 20:22:56 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id m2so2130127pjv.2 for ; Thu, 04 Jun 2020 20:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QyQw+sLIla93dlac0TERwcz4aWSKJuqSco16Wn/VCK0=; b=oApTUVbvRfwUXQkyK9U+0EK+y9ZjZdvqoGei9Z2c+lWyA4V9WeC6RwySmnttTG6h6R J5FKeKiU9vufOnBhhFWruh7l2jnbuXC8HWckjX0IWbOhN+hgkr19jyYnvyUKtb9GTheu evTg8bf8NZZU26vKyLPUwu2n9wMheLWcgtUV6877z7H0Zr5+wAxY7sqTsokSArUmkoJa 77CgaSzTGld6I7+o8tUozYfgSTrnAM0/BRZqTO7g6feV+eKBM4odUNA3qXqctA8zH9JB ScsFF9jE/IDuxxV3ZgUfLedbHUBWt3W81bm87m3jv5JSAc39E9TYoGsaPR5oEcTt461g XBSA== 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=QyQw+sLIla93dlac0TERwcz4aWSKJuqSco16Wn/VCK0=; b=q5gsd4cQQitwBYy6RNrJ7zBr4bbHeDlQMcbMdvhdZpiIRgA9/gqah33+4EKktZMwix LugPcqF0okcUfuKSjaW5ahewVFco/mmSCA5i46+Z+DtMiuwnuSdNkhAUA4QzVl2n7dQw EzZITIJ/Q8peLTEBnNHYf+JrqEW4oSuE2cB0kgKuy2uBtiv2yPbv4wT/J/vPOaToEKO/ p5Xc3xPH8bb2G39/jg1nN2JUveq6zqcPP2WNj1ka66nzELcDbFrEQR81ELN+CpXqj51e 6pjPOLRKUgce6RjT8GGFXP3Oi+84rIgsi/dL7pZ+3gKKC7eA4Q73PBjeJafX2Zq1EEHu 6S4w== X-Gm-Message-State: AOAM531isvJ7pf7KxRH7A11befVXHv4QZXNmjNcmvwvk8UKjnYW3wMOi i/qunaTvryfQ5ZhPnmuMdljJrg== X-Received: by 2002:a17:90a:2222:: with SMTP id c31mr570134pje.200.1591327376490; Thu, 04 Jun 2020 20:22:56 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id a14sm5520589pfc.133.2020.06.04.20.22.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2020 20:22:55 -0700 (PDT) Subject: Re: [PATCH v2 5/6] block: nr_sects_write(): Disable preemption on seqcount write To: "Ahmed S. Darwish" , Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , Vivek Goyal , linux-block@vger.kernel.org References: <20200603144949.1122421-1-a.darwish@linutronix.de> <20200603144949.1122421-6-a.darwish@linutronix.de> From: Jens Axboe Message-ID: Date: Thu, 4 Jun 2020 21:22:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200603144949.1122421-6-a.darwish@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/20 8:49 AM, Ahmed S. Darwish wrote: > For optimized block readers not holding a mutex, the "number of sectors" > 64-bit value is protected from tearing on 32-bit architectures by a > sequence counter. > > Disable preemption before entering that sequence counter's write side > critical section. Otherwise, the read side can preempt the write side > section and spin for the entire scheduler tick. If the reader belongs to > a real-time scheduling class, it can spin forever and the kernel will > livelock. Applied, thanks. -- Jens Axboe