Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753573AbbGBTQ1 (ORCPT ); Thu, 2 Jul 2015 15:16:27 -0400 Received: from mail-ig0-f172.google.com ([209.85.213.172]:33870 "EHLO mail-ig0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753650AbbGBTQP (ORCPT ); Thu, 2 Jul 2015 15:16:15 -0400 MIME-Version: 1.0 In-Reply-To: <20150702184015.GO17109@ZenIV.linux.org.uk> References: <20150701082753.GD17109@ZenIV.linux.org.uk> <5593A7A0.6050400@samsung.com> <20150701085507.GE17109@ZenIV.linux.org.uk> <5593CE37.4070307@samsung.com> <20150701184408.GF17109@ZenIV.linux.org.uk> <20150702032042.GA32613@ZenIV.linux.org.uk> <20150702080026.1c32f1c7@tlielax.poochiereds.net> <20150702080738.615e1c52@tlielax.poochiereds.net> <20150702164535.GM17109@ZenIV.linux.org.uk> <20150702130139.35e01106@tlielax.poochiereds.net> <20150702184015.GO17109@ZenIV.linux.org.uk> Date: Thu, 2 Jul 2015 12:16:14 -0700 X-Google-Sender-Auth: 8F2BbPx2wTWBNd1w8Td-slTzc_o Message-ID: Subject: Re: [git pull] vfs part 2 From: Linus Torvalds To: Al Viro Cc: Jeff Layton , Andrey Ryabinin , Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1571 Lines: 34 On Thu, Jul 2, 2015 at 11:40 AM, Al Viro wrote: > > All they are used for is matching response to request. Basically, you > can have up to 65535 pending requests. Reusing it right after getting > the response is fine. Reusing a tag right after getting the completion may be fine in theory, but it still sounds like a bad idea. Sure, it's used to match the command with the reply, but using those kinds of things for matching re-sends and to index into various "current data structures" is also very common (not having looked at p9 I don't know how much it does), and basically reusing tags "soon" tends to make those kidns of things fragile. Which can easily turn a "this _should_ work" into "it doesn't _actually_ work" just because it ends up making things like race conditions and re-ordering of replies trigger worse behavior. For example, things like "done with previous command X" and "now starting new command X" - if the tag is the same and those *independent* messages get re-ordered, the tag just failed in what it was supposed to do. So circular allocators are likely a good idea even if there are other layers that should handle retransmits etc. So it does sound like it would be better to use a circular tag allocator rather than a "lowest tag first" allocator. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/