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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 BE6C4C43603 for ; Thu, 5 Dec 2019 17:33:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 999D724648 for ; Thu, 5 Dec 2019 17:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575567206; bh=r67g/9hiA927KJVVx+cBd7MCpOd+2xqMrxYTzGwUZns=; h=References:In-Reply-To:From:Date:Subject:To:List-ID:From; b=KjVUEO1V9tU6fWUGZrc87wDH80KrkMWqzXnbpZ7ukkV/CsNfcazrXVMv0Agy1Sir7 /YU0IAldE/KVjim7aQxSntH80EKsX5mShJZQCYPkpUerTg4DLfeP0HzL7+/cVuSHWh Kpmv12L/seA8hsJ2DVYVvpltCzn4XBRZlERQWl4I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730142AbfLERdZ (ORCPT ); Thu, 5 Dec 2019 12:33:25 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40716 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730033AbfLERdZ (ORCPT ); Thu, 5 Dec 2019 12:33:25 -0500 Received: by mail-lf1-f66.google.com with SMTP id y5so3116310lfy.7 for ; Thu, 05 Dec 2019 09:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=/eKd/FDqrplPYUuvbR0AiU2l8M+m4LPxDGweCaRKq6w=; b=M56np70zVr1VfiJPsuEXyT4OG9+Mgq+nZRonIdlMO0qNjSITB1EVwHnE+jM9THnBNz 3vX00ZNLigUAoH1Qop/bcwkoEis8chlXpTrSREoavAISt/m/5l5mLyPd23rMwP17l/QA 7M9TY3swoS1z9u0iCZT3it6ySOEzIm2iiZPAY= 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; bh=/eKd/FDqrplPYUuvbR0AiU2l8M+m4LPxDGweCaRKq6w=; b=V8HB6gigaOZWu7BP02qpK8OgT5CRprIyiAmCPvtdtbjbUjB2nHfIaSgVm5nKKv4Ivc JgKro5VCfFJs0MA5uGY4xE3mIInpVRDQ1gHDJw2BIgzig3Ec2cl7VPWCbylYnPnCWt08 PZimMKilyhfB8mEMlIpcWlXLZys7AGOA2MNC+bsLkFmDoEUdr88Rj+TMVQwCYZKtlK/Y Tzx9eTb9HUcoadleG4YWMgLGOVGhph6G983JtOFu6xXqJlKgSuK4FoSgyf8hdeh/Wuyk i1yc7WxCD2CWxeu48xa9MVykHZtdQp/+SlVZ3FPwEG3qNiHLCa4sLqxGQ0+gfzVjOphu MGqg== X-Gm-Message-State: APjAAAWdt/R0ofRiX91Gg3hF8F1Orogqahg5aYYrkcNTNEY+2vbVkdT4 t3VHeFYK7ngc6QFtF1GQqCEp1CjDs2o= X-Google-Smtp-Source: APXvYqwpzJaqSSJJQy7WL9gkcz9LhgpGiqwXUoaNC6nlXhCcDQLSZpliO4oyaWbGTJ4Mg/OnN89kCw== X-Received: by 2002:a19:dc14:: with SMTP id t20mr5898082lfg.47.1575567202120; Thu, 05 Dec 2019 09:33:22 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id m24sm5232922lfl.34.2019.12.05.09.33.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Dec 2019 09:33:21 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id m30so3103190lfp.8 for ; Thu, 05 Dec 2019 09:33:20 -0800 (PST) X-Received: by 2002:ac2:430e:: with SMTP id l14mr2520386lfh.79.1575567200366; Thu, 05 Dec 2019 09:33:20 -0800 (PST) MIME-Version: 1.0 References: <20191205125826.GK2734@twin.jikos.cz> <31452.1574721589@warthog.procyon.org.uk> <1593.1575554217@warthog.procyon.org.uk> <20191205172127.GW2734@suse.cz> In-Reply-To: <20191205172127.GW2734@suse.cz> From: Linus Torvalds Date: Thu, 5 Dec 2019 09:33:04 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] pipe: Notification queue preparation To: David Sterba , David Howells , Linus Torvalds , Rasmus Villemoes , Greg Kroah-Hartman , Peter Zijlstra , raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , LSM List , linux-fsdevel , Linux API , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Dec 5, 2019 at 9:22 AM David Sterba wrote: > > I rerun the test again (with a different address where it's stuck), there's > nothing better I can get from the debug info, it always points to pipe_wait, > disassembly points to. Hah. I see another bug. "pipe_wait()" depends on the fact that all events that wake it up happen with the pipe lock held. But we do some of the "do_wakeup()" handling outside the pipe lock now on the reader side __pipe_unlock(pipe); /* Signal writers asynchronously that there is more room. */ if (do_wakeup) { wake_up_interruptible_poll(&pipe->wait, EPOLLOUT | EPOLLWRNORM); kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); } However, that isn't new to this series _either_, so I don't think that's it. It does wake up things inside the lock _too_ if it ended up emptying a whole buffer. So it could be triggered by timing and behavior changes, but I doubt this pipe_wait() thing is it either. The fact that it bisects to the thing that changes things to use head/tail pointers makes me think there's some other incorrect update or comparison somewhere. That said, "pipe_wait()" is an abomination. It should use a proper wait condition and use wait_event(), but the code predates all of that. I suspect pipe_wait() goes back to the dark ages with the BKL and no actual races between kernel code. Linus