Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1325897imm; Tue, 22 May 2018 02:10:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrnzdYJ/HFfm3iFC3b9zrqBd4/3tETGTrDVv5p/g5Yse89o5iGRbEena1y+sMjn4QeHAcYq X-Received: by 2002:a62:ecdc:: with SMTP id e89-v6mr23501708pfm.33.1526980200824; Tue, 22 May 2018 02:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526980200; cv=none; d=google.com; s=arc-20160816; b=YDTp9SoHiABmdM6dTk5z7KhLIVjAvSdt3sXaiFatoho2cl2sFMWXQSW0Q8mmY1RlNw GHCu37+872WAe2bfOMsySbr8cbgLpzViD9fzbRVkDMClpyVVa5neNXBhPA8hw+/s4OrB NvON254plBxBzwe+YQwp+HAf7vGOu3176Nz11z2Bv8eScJWOWMJhogxKVrGeVvqg/8E7 s7Yc4OYmU1RV0/PHeNHL6+YLbldveK//G73VNaq/xqtdRL/GDy4eVnCLq2Qp+pvgk1g0 CHX9tEvU9pLAfSIjU21rMhGm7YNs2wjHLe3X2qovket/j7ts+06iH/pGnV46jKGsKAmJ pvpw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=JitWXA9tE8aKsJhBYE3i8IwArtwyx7oSXC/dD3FHQ00=; b=ZrDU8AiYsteNX8isLZm/0qZofxXEXWFLaSeo7PomK2vH1MMuPa+Bth4RDNKZ1WhRQL I/NFKvWar9SuX4nuMAdHLtnagaevMQzxDir7Lc+ivBX+YsqJ7zx9pqgLGFkgu3aRkLMR APkfLl2dZ7gwwMuP2ShlkQSzEdxaPD9Cw8m5ETT6j0amsDOQDcL5EOlJRCyBsEa1eBKR 5LKBqi6yH1d08h2hnBbz2jjQegzfgooj0i0KpW+3yM0OFqe5dwzhi5+xioGQWquRZ/wc jhV7rQVv4WttV7dogXJqX1I3NNydfz88Cl51sKmtZlf5T9LeIidg5IofuYp7GFz5rHGL i3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=X+ajzG8B; 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 n9-v6si15333520plk.584.2018.05.22.02.09.46; Tue, 22 May 2018 02:10:00 -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=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=X+ajzG8B; 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 S1751390AbeEVJJe (ORCPT + 99 others); Tue, 22 May 2018 05:09:34 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:45190 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbeEVJJ3 (ORCPT ); Tue, 22 May 2018 05:09:29 -0400 Received: by mail-io0-f194.google.com with SMTP id c9-v6so17596506iob.12 for ; Tue, 22 May 2018 02:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JitWXA9tE8aKsJhBYE3i8IwArtwyx7oSXC/dD3FHQ00=; b=X+ajzG8BpvZGWDl2gRmcyiCHlJiH8od4c8JWgZlgudQqtCtOhihESeMPvr19RRHO66 AGuGcmaGB8NCyuon5JelN7zJHYk8S4skQ9TZUkJCXVcO1MdNhf+lJgvPcsXt78O0cMk0 gXtEGjf6GqjFqJy3OVnLbZy6HMg9TI0sFd22Td9p0wgf1eXfMNdgW+Gkl8Vy1b+a0aCr u6irWOpMAhdwPe7FYO3oQh6kNBGSvo/NISgrTjwk4icZuJSpjnWGTRxDgzLwYQCKNsbL RJ77ncMKukPO8LtSJX6I6emunGoMQNDEYf/z9UUiZf0y+4ReJLzjW/ohl/8J0He/lXu9 0Tow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JitWXA9tE8aKsJhBYE3i8IwArtwyx7oSXC/dD3FHQ00=; b=tfhLsf4voKdjUXpJEf9SwEqUTYIClnPaKy6T67FN5Oj/HGCMr2n2Uy0ervmHRgxdNx dv8KVItphcX71Lmi5O9kzogW8VT6k2fhzk2Az/ZeS5PfPOY1yHlbPzcfGHBeU/KhuvpF Kl8B5pU436lYQkRrSOpY3/eAfdmA7TLJl1QX278PmhifPnsWh3Wch7U4e2bXIGnHwIP5 NA8GtcVDu+4Z8teBV26pZu+PuMhZedZ/NzqTVTXC/Zv5Aq7U5CvrnJH73cHZdLT9OrBt IyWxozDi+ko7Gu3fqIza23pddS0FWl3wyTxWj+wA8FRjUPcPPw9PG6Bk4CMkk3Y9LXmS BRvQ== X-Gm-Message-State: ALKqPwePKN6J0+ToQDYFEqDnrXfxzIEdWpgTd0YEn+peCdbC+Y9RoJG4 NaoC2lY5Z6fkBd5V8uyb+KzjhWWNC90D0WZCxiS64Q== X-Received: by 2002:a6b:1fd2:: with SMTP id f201-v6mr26068205iof.74.1526980168908; Tue, 22 May 2018 02:09:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.140.210 with HTTP; Tue, 22 May 2018 02:09:08 -0700 (PDT) In-Reply-To: <20180521153337.GF3803@linux.vnet.ibm.com> References: <20180518130413.16997-1-roman.penyaev@profitbricks.com> <20180518130413.16997-2-roman.penyaev@profitbricks.com> <20180519163735.GX3803@linux.vnet.ibm.com> <20180520004318.GY3803@linux.vnet.ibm.com> <20180521153337.GF3803@linux.vnet.ibm.com> From: Roman Penyaev Date: Tue, 22 May 2018 11:09:08 +0200 Message-ID: Subject: Re: [PATCH v2 01/26] rculist: introduce list_next_or_null_rr_rcu() To: "Paul E . McKenney" Cc: Linus Torvalds , linux-block , linux-rdma , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Bart Van Assche , Or Gerlitz , Doug Ledford , "swapnil.ingle" , Danil Kipnis , Jinpu Wang , 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 Mon, May 21, 2018 at 5:33 PM, Paul E. McKenney wrote: > On Mon, May 21, 2018 at 08:16:59AM -0700, Linus Torvalds wrote: >> On Mon, May 21, 2018 at 6:51 AM Roman Penyaev < >> roman.penyaev@profitbricks.com> wrote: >> >> > No, I continue from the pointer, which I assigned on the previous IO >> > in order to send IO fairly and keep load balanced. >> >> Right. And that's exactly what has both me and Paul nervous. You're no >> longer in the RCU domain. You're using a pointer where the lifetime has >> nothing to do with RCU any more. >> >> Can it be done? Sure. But you need *other* locking for it (that you haven't >> explained), and it's fragile as hell. > > He looks to actually have it right, but I would want to see a big comment > on the read side noting the leak of the pointer and documenting why it > is OK. Hi Paul and Linus, Should I resend current patch with more clear comments about how careful caller should be with a leaking pointer? Also I will update read side with a fat comment about "rcu_assign_pointer()" which leaks the pointer out of RCU domain and what is done to prevent nasty consequences. Does that sound acceptable? -- Roman