Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933244AbcJQUiG (ORCPT ); Mon, 17 Oct 2016 16:38:06 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56577 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932306AbcJQUh5 (ORCPT ); Mon, 17 Oct 2016 16:37:57 -0400 From: Arnd Bergmann To: Bart Van Assche Cc: Binoy Jayan , Doug Ledford , Sean Hefty , Hal Rosenstock , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 0/8] infiniband: Remove semaphores Date: Mon, 17 Oct 2016 22:37:38 +0200 Message-ID: <11072595.MMy2tvNZxU@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <8c560960-5498-57b5-6da6-218b71d9eef9@sandisk.com> References: <1476721862-7070-1-git-send-email-binoy.jayan@linaro.org> <6244597.a6XMUIxjP0@wuerfel> <8c560960-5498-57b5-6da6-218b71d9eef9@sandisk.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:zZZf+NdNHMUtxPJW2TV8hxa0oo9YNsetyWRXOH1B0sXPKhJmyPc YXZNO/rckRkJh4YO+/QxD3Oc2qZLc8EnKpiU784j7w2thOb93iORALtQUgqMfnY/kz6m9/i oMWMYgzzNLOJ7srdpboY1rmWmbVQEE428+cft3hsJPNltqJ4O8ui/5SAX7mZl/sg3y/Gpl2 ywcL457KYvCeezcD95Agw== X-UI-Out-Filterresults: notjunk:1;V01:K0:lKQOBsSp8Vw=:vOpNPCEewtZNX4Xvk1BiyH 0j1bY/OnH8HZSbi8nWWLpC5k5ulMrrJVieMsfQHVdYhAbIfrfZ2Px+QW8OjACK6GdD2GQ0ibs xrNps0dNx0Jn+Il4QDyvye7GrIaQht1QSbXGcjYdFz54ggD6NzxWH+F7nvT9gQszaHkGwNlXO lwosQ6o/bmZcpl4WVR7zSXQjYBwub8gz/ZOk0R5JtWoOTu5IKel48xRrxE1deqxLuLe0Btr4s zJaZt5qalpRWALo+Km59Luwl5Jel6dYeeRXeXNHl3ms8ypw1DLxOI2Flx1fmkMteDop9b9/N0 rd0J22pV1JBpCsq4lV4OzP2haGd1g4p4Ex7yt8ZL6XFkOYrJyc0PMaAQGoSvuDBW1wL4frz1g vJ4RvocBf5N9r61Re7rZPRg8z0f8u8c1QUy9evXztoRsiZOY8XcHDiH03P9UR0RmkU+lN7bCQ ZUzGZvaU5b31N0w5imvp7LKbmU638oum+DCZLQ/gi+TQTGMDsh1vEBGcO2tp3fcXWkXd16Zor gEaBK/M5Z1IhvfS2aUCQAmEKR7bHYj/2QgdkoEnExBPuHH3dASbf4tPTA0neDevH7nS8rZfwl bVDK9n0mhOVBBVjMpxOy0QVJcT0YP6WExmBSF6vWOBaJ2U8z9owfqiSDyUaY2newi23HdrCcx 30mKEXg8OiT1RYh920kUCsUNuXvFocc3XVkleQo0tjI1Tj4WMOLJDYLGem0ibkiLcQv3ZNH17 +7VtVvsSyqdOy17D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 28 On Monday, October 17, 2016 1:28:01 PM CEST Bart Van Assche wrote: > On 10/17/2016 01:06 PM, Arnd Bergmann wrote: > > Using an open-coded semaphore as a replacement is probably just > > the last resort that we can consider once we are down to the > > last handful of users. I haven't looked at drivers/infiniband/ > > yet for this, but I believe that drivers/acpi/ is a case for > > which I see no better alternative (the AML bytecode requires > > counting semaphore semantics). > > Hello Arnd, > > Thanks for the detailed reply. However, I doubt that removing and > open-coding counting semaphores is the best alternative. Counting > semaphores are a useful abstraction. I think open-coding counting > semaphores everywhere counting semaphores are used would be a step back > instead of a step forward. Absolutely agreed, that's why I said 'last resort' above. I don't think that we need to go there for infiniband. See my reply for patch 6 for one idea on how to handle hns and mthca. There might be better ways. These fall into the general category of using the counting semaphore to count something that we already know in the code that uses the semaphore, so we can remove the count and just need some other waiting primitive. Arnd