Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5969971imm; Sat, 19 May 2018 13:57:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpdPMQE+6oluLxq8N5/89GSNTLFflfEc3jsAQpwPHH2nzNmYcm+m4TEb6fEpyOMGhRvh7ot X-Received: by 2002:a63:6b43:: with SMTP id g64-v6mr11310598pgc.337.1526763476808; Sat, 19 May 2018 13:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526763476; cv=none; d=google.com; s=arc-20160816; b=qbrB4r0sxr+JfQSGj9+TM3Y8aHfUb5rBhdeRbLstWdS7lxv2q5VLt6J9ZePGBqZIO3 wTwDMaoDDjl2YxXUgxQScAKyRnggrLd+hmZ6WcIwXq6xOw3EbteQzZxA/nqfqwfMHfiX cSfS3TdKiv/4os2zIASSEEO3B8/cfpK76DKtKYR/OlgYkk5SlBEqVZ3NAVUN4RIW8HJ2 XgyMLYeGMPmrRjZp0n4po5l0ZYHyq4BfxXRpoj6allv+khnxAwo9fQaFDwrYJTMw/VDU bVpdTAUPAEt7+gZZj8/+bE0oRJbwNUuuoWm2CAMyZtZ/ZUZnT6lnZrdyRyb/81JU0dNT NCsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=0lNvWgZpB1T+fZaeXOWqOsQN9NKW4WLboDgrVgjmdN0=; b=V251TlW7C9TYkGez6PJyQ9GkGyobueA0f/y1YDECeCUQHFW+WtDsqgcYZ2EOr+WOYU U+TLHW5wkqDPHiK0Zj40nBxditokmX3GvNX2+3N7gIn3z30tY6cqAgbaUaIual6GIIcm +aS5hYMY+zIhSae15k9bG/j01VyhDIlXi5j8jNHKHIYE9fwtg+oFT5YzJ1j6JEIsHQRg KjGRzVy2vPyZIFPXBIS84Rm5k3Y7QduKqKI7vViGxJ3sBJe6QHV/G3yj1U+QkFV53Uu9 aE5vBlkercxWfuhYXH5MsognSrUO/zLCSN6L2KB7UouwxsDWpannOLuyCXCYKw3qByir ljNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QexBJTQc; 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 m188-v6si4711139pga.107.2018.05.19.13.57.11; Sat, 19 May 2018 13:57:56 -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=@linux-foundation.org header.s=google header.b=QexBJTQc; 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 S1752565AbeESU5A (ORCPT + 99 others); Sat, 19 May 2018 16:57:00 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:55055 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbeESU45 (ORCPT ); Sat, 19 May 2018 16:56:57 -0400 Received: by mail-it0-f68.google.com with SMTP id z6-v6so17110998iti.4; Sat, 19 May 2018 13:56:57 -0700 (PDT) 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 :cc; bh=0lNvWgZpB1T+fZaeXOWqOsQN9NKW4WLboDgrVgjmdN0=; b=QexBJTQcGgFG4tivOqhNHVebnmbhnpIJed2ZhPtKIig5816FYgri4TxW0cjIfJIC0X YbuJXJMpErKO4k20NmMM/6x4Rsqe/of17PkRu1h+xk7fQG2OR3MZ9BavOcWT9/+rOYzd DTybfxUO47CPsozRD4RF+ShwCtT5YP8EKgrEo= 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:cc; bh=0lNvWgZpB1T+fZaeXOWqOsQN9NKW4WLboDgrVgjmdN0=; b=JL7sucYL69ST7ajpskVhpSKm/mAqQz02/MJ4Hr4Sg+1sYZlXMYP0fLSeZ+Qu6huCO/ ijmBBp3v15RTSBLrtxA3XI2gcYw7Gvhj2hXbDV/Q9e9/lfsx7n+/0BBD31tXv5DQUsxo nqPUlxoyMcunn6df8SiJKlSv9PoIAoP0uBCib94uu7RWUaa0EfNwrLRIa+aVJvSPeXL1 Y0Ck2wd8MV9VzBb6P60pcH8jwf8JUF+F5QNQ7Svtmh3WTW7zkv8EUr2lTlZC8ZlMatp/ jZ1TFonrGYhAyvvSXB0x6b1aI9sT0WfO6iCo56ZqbTAZpq4HwSskoGgnEWeJJxOO70kw KdJw== X-Gm-Message-State: ALKqPwfmRAFoQMAE2LmtTl2vldSNpOz43uojgWi8u4uvSfrYE5430MYU NUIAHoeWUiJJO8w3E1JYItmG1uhp3v+xggjlMP1eq4wQ X-Received: by 2002:a24:4c55:: with SMTP id a82-v6mr11868578itb.1.1526763416849; Sat, 19 May 2018 13:56:56 -0700 (PDT) MIME-Version: 1.0 References: <20180518130413.16997-1-roman.penyaev@profitbricks.com> <20180518130413.16997-2-roman.penyaev@profitbricks.com> <20180519163735.GX3803@linux.vnet.ibm.com> In-Reply-To: From: Linus Torvalds Date: Sat, 19 May 2018 13:56:45 -0700 Message-ID: Subject: Re: [PATCH v2 01/26] rculist: introduce list_next_or_null_rr_rcu() To: Roman Pen Cc: Paul McKenney , linux-block , linux-rdma , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Bart Van Assche , Or Gerlitz , Doug Ledford , swapnil.ingle@profitbricks.com, danil.kipnis@profitbricks.com, jinpu.wang@profitbricks.com, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 19, 2018 at 1:21 PM Roman Penyaev < roman.penyaev@profitbricks.com> wrote: > I need -rr behaviour for doing IO load-balancing when I choose next RDMA > connection from the list in order to send a request, i.e. my code is > something like the following: [ incomplete pseudoicode ] > i.e. usage of the @next pointer is under an RCU critical section. That's not enough. The whole chain to look up the pointer you are taking 'next' of needs to be under RCU, and that's not clear from your example. It's *probably* the case, but basically you have to prove that the starting point is still on the same RCU list. That wasn't clear from your example. The above is (as Paul said) true of list_next_rcu() too, so it's not like this is anything specific to the 'rr' version. Linus