Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1166974ybd; Sun, 23 Jun 2019 01:33:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2472aozOQkyimysilqwGdkkZAKYb6kmEsWw/j0cKdBQW4YAv22UKmr0FWu98eskv6DKJk X-Received: by 2002:a63:fc61:: with SMTP id r33mr2983833pgk.294.1561278838379; Sun, 23 Jun 2019 01:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561278838; cv=none; d=google.com; s=arc-20160816; b=IBDcfa5RGSc54C7R6GM3F7XJvFtbgarsJTRYkkBXMfU2t8+WZ1tChBWI3dJysfUYpY SJ3E4M4/sLJNsiVQaxrgbEv8kmjsM1EC9tgA550DDLsLpoTG0SB8TJrAzkck+hU/ZCP1 /usx0Ruh69aa21W48UCo5M10gNuAhPaFR0TKQXK1soPk7gl1LSSj1LGW1faVGHQiHSSl FwA0f+2e1ZXoTJNjcI4gtpLxZPj5PtxZqWnHt1K+VH+TMEo0VglxdgI+A9mUhaYMPJhO X3Vd8O5TZcPRtjIQ+3bf7nr3pnJBZQLy8GoDI4RbnD/7+9XMtffHqzr+DxHxq7u5mbH2 XtWQ== 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:mime-version :date:in-reply-to:message-id:cc:to:subject:from:dkim-signature :dkim-signature; bh=43Z5tU8a6uZY8167nIjWOY/Bo/wPuHg/vyCerkiRXnY=; b=cgaqT2NEU/L8MnAF/T+Nlj76Bl4w5QQFUOGSoyjBC1vT+qr0ciiQa5ir/ZxMMTyIsY ThcOtAvvMgx2I23GJTbSpD+CCcmtExjth3JJkyU1zbIVIW09KG6uYWk66c11sFHFleta ys3So7kZ3SWORawdgWLYbwjLT2mW0VqlkwTsrJFuxB600QjEPep024EAVs2f08ESrKpe g0ot6mXyrqw8sd3zk6IhY6FCEnm8eHlHMw1V8UhDf0YMJACU0Mztc/gs7WwScIjnX90Q kW16bOA3qRf7YXD3qu7pmpVUWaBq/BRhxCLn83uvb/sozjvbqRriA73wx4QTdniOBWPs nusQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=le5yfpgO; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=j9NpUT6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i2si4738797pfb.206.2019.06.23.01.33.30; Sun, 23 Jun 2019 01:33:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@nexedi.com header.s=mandrill header.b=le5yfpgO; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=j9NpUT6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbfFWIdH (ORCPT + 99 others); Sun, 23 Jun 2019 04:33:07 -0400 Received: from mail10.wdc04.mandrillapp.com ([205.201.139.10]:17141 "EHLO mail10.wdc04.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfFWIdG (ORCPT ); Sun, 23 Jun 2019 04:33:06 -0400 X-Greylist: delayed 900 seconds by postgrey-1.27 at vger.kernel.org; Sun, 23 Jun 2019 04:33:05 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:In-Reply-To:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=43Z5tU8a6uZY8167nIjWOY/Bo/wPuHg/vyCerkiRXnY=; b=le5yfpgOtyiKom34YiICaF5wvbgMTaxRyMeNN1ux2bg20C6onlB0GZF7OQntIwmUUs09T23cYcHd Y9aNVCzCEuNzZHj7g5schBgetFiUzec0cOQ92qiLSrrAtYICagO3A7Tzd/Bp84t9EhXltfGfXARX 8NKVk+1aHFY/oAxKwlY= Received: from pmta08.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail10.wdc04.mandrillapp.com id h1ssk21jvmgd for ; Sun, 23 Jun 2019 08:18:05 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1561277885; h=From : Subject : To : Cc : Message-Id : In-Reply-To : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=43Z5tU8a6uZY8167nIjWOY/Bo/wPuHg/vyCerkiRXnY=; b=j9NpUT6OucEMfBjQgQbrAvAzwOUFe2A8N8P00ZHmd71K9OQ3gIy5ol02dyQHLug/MRpSEt a/kT7KNeCd8XlrGltYMWJ17s63ZHmn0vHLUbmoLLiK25P3t79baNoo5oRAiZNYzGduL5hrMq hPFT5P6jilhhdJaJy3Oxrq2+V1/+w= From: Kirill Smelkov Subject: Re: [PATCH 1/2] coccinelle: api/stream_open: treat all wait_.*() calls as blocking Received: from [87.98.221.171] by mandrillapp.com id 71c2fdbf648d4043916ffdf5dce1f1d5; Sun, 23 Jun 2019 08:18:05 +0000 To: Julia Lawall Cc: , , Logan Gunthorpe , Sebastian Andrzej Siewior , Bjorn Helgaas Message-Id: <20190623081800.GA1889@deco.navytux.spb.ru> In-Reply-To: X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=31050260.71c2fdbf648d4043916ffdf5dce1f1d5 X-Mandrill-User: md_31050260 Date: Sun, 23 Jun 2019 08:18:05 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 23, 2019 at 10:02:17AM +0200, Julia Lawall wrote: > On Sun, 23 Jun 2019, Kirill Smelkov wrote: > > On Sun, Jun 23, 2019 at 09:35:17AM +0200, Julia Lawall wrote: > > > On Sun, 23 Jun 2019, Kirill Smelkov wrote: > > > > > > > Previously steam_open.cocci was treating only wait_event_.* - e.g. > > > > wait_event_interruptible - as a blocking operation. However e.g. > > > > wait_for_completion_interruptible is also blocking, and so from this > > > > point of view it would be more logical to treat all wait_.* as a > > > > blocking point. > > > > > > > > The logic of this change actually came up for real when > > > > drivers/pci/switch/switchtec.c changed from using > > > > wait_event_interruptible to wait_for_completion_interruptible: > > > > > > > > https://lore.kernel.org/linux-pci/20190413170056.GA11293@deco.navytux.spb.ru/ > > > > https://lore.kernel.org/linux-pci/20190415145456.GA15280@deco.navytux.spb.ru/ > > > > https://lore.kernel.org/linux-pci/20190415154102.GB17661@deco.navytux.spb.ru/ > > > > > > > > For a driver that uses nonseekable_open with read/write having stream > > > > semantic and read also calling e.g. wait_for_completion_interruptible, > > > > running stream_open.cocci before this patch would produce: > > > > > > > > WARNING: _fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open. > > > > > > > > while after this patch it will report: > > > > > > > > ERROR: _fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix. > > > > > > Are you really sure that every word that starts with wait_ in the Linux > > > kernel has the property you want? How many of them are there? Would it > > > be reasonable to put the names in the semantic patch explicitly? > > > > We are talking about function calls or macros here only. I think that > > by default every "wait.*()" has blocking semantic, and if there are > > something that does not block, it should be instead white-listed with > > the default still being treated as "all wait.*() blocks". > > > > Here are the list of wait functions & macros (if I read tags format > > correctly). They were generated with `grep -w d tags |grep '^wait'` and > > `grep -w f tags |grep '^wait'`. Offhand they all seem to be of blocking > > kind to me. > > OK, thanks for the list. > > julia On Sun, Jun 23, 2019 at 10:01:52AM +0200, Julia Lawall wrote: > Acked-by: Julia Lawall Julia, you are welcome. Thanks for ACK. Kirill