All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Xin Long <lucien.xin@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	dave.hansen@intel.com, davem <davem@davemloft.net>,
	Oleg Babin <obabin@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: Re: [PATCH 6/6] Drop flex_arrays
Date: Tue, 18 Dec 2018 07:19:12 -0500	[thread overview]
Message-ID: <20181218121912.GA2078@hmswarspite.think-freely.org> (raw)
In-Reply-To: <20181217125011.GA28294@kmo-pixel>

On Mon, Dec 17, 2018 at 07:50:11AM -0500, Kent Overstreet wrote:
> On Thu, Dec 13, 2018 at 01:09:17PM -0500, Neil Horman wrote:
> > On Thu, Dec 13, 2018 at 08:45:33AM -0800, Matthew Wilcox wrote:
> > > On Thu, Dec 13, 2018 at 10:51:49AM -0500, Neil Horman wrote:
> > > > On Thu, Dec 13, 2018 at 06:41:11AM -0800, Matthew Wilcox wrote:
> > > > > On Thu, Dec 13, 2018 at 09:30:47PM +0900, Xin Long wrote:
> > > > > > On Sat, Sep 8, 2018 at 1:57 AM Kent Overstreet
> > > > > > <kent.overstreet@gmail.com> wrote:
> > > > > > >
> > > > > > > All existing users have been converted to generic radix trees
> > > > > > NAK, SCTP is still using flex_arrays,
> > > > > > # grep flex_array net/sctp/*
> > > > > > 
> > > > > > This patch will break the build.
> > > > > 
> > > > > sctp added that user after this patch was sent.  Please stop adding
> > > > > flexarray users!
> > > > > 
> > > > > This particular user should probably have just used kvmalloc.
> > > > > 
> > > > 
> > > > No, I don't think thats right.
> > > > 
> > > > This appears to have been sent on September 7th.  Commit
> > > > 0d493b4d0be352b5e361e4fa0bc3efe952d8b10e, which added the use of flex_arrays to
> > > > sctp, seems to have been merged on August 10th, a month prior.
> > > 
> > > Are you seriously suggesting anybody sending cleanups needs to be
> > > monitoring every single email list to see if anybody has added a new user?
> > > Removing the flexarray has been advertised since May.
> > > https://lkml.org/lkml/2018/5/22/1142
> > > 
> > I don't see how thats any more egregious than everyone else having to monitor
> > for removals of code thats in the tree at some indeterminate future.  The long and the short of it
> > is that a new flex_array user was added in the intervening 7 months that this
> > patch has been waiting to go in, and it will now break if merged.  I'm sorry we
> > started using it during that time, but it got missed by everyone in the chain
> > that merged it, and hasn't been noticed in the 4 months since.  It is what it
> > is, and now it needs to be undone. 
> > 
> > > > regardless, however, sctp has a current in-tree use of flex_arrays, and merging
> > > > this patch will break the build without a respin.
> > > 
> > > Great.  I await your patch to replace the flexarray usage.
> > Sure, we'll get to it as soon as we can, or, if you are in a hurry, you can
> > replace the same usage, like you've done for all the other users in this series.
> 
> This is really my fault for slacking on getting generic-radix-trees in, and
> given that the sctp code has been merged I'll do the conversion.
> 
Thank you, I appreciate that.

> However.
> 
> Looking at the sctp code, honestly, wtf is going on here.
> 
> sctp_send_add_streams() calls sctp_stream_alloc_out() when it wants to make the
> out flex_array bigger - ok, this makes sense, you're using a flex_array because
> you want something resizable.
> 
> But wait, look what it actually does - it unconditionally frees the old flex
> array and preallocates a new one and copies the contents of the old one over.
> 
> Without, as far as I can tell, any locking whatsoever.
> 
> Was this code tested? Reviewed?
> 
Yup, both sides are protected by the socket lock for which the sctp connection
is associated.  Its locked in the sctp_setsockopt function, which is the path
through which we update/reallocate these flex arrays, and its also locked on
transmit in sctp_sendmsg, and on receive in sctp_rcv (via bh_lock_sock)

Neil


  reply	other threads:[~2018-12-18 12:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 16:56 [PATCH 0/6] flex_arrays -> genradix; prep work for bcachefs Kent Overstreet
2018-09-07 16:56 ` [PATCH 1/6] openvswitch: convert to kvmalloc Kent Overstreet
2018-09-07 17:19   ` Matthew Wilcox
2018-09-07 16:56 ` [PATCH 2/6] md: " Kent Overstreet
2018-09-07 17:49   ` Matthew Wilcox
2018-09-07 18:16     ` Kent Overstreet
2018-09-07 16:56 ` [PATCH 3/6] selinux: " Kent Overstreet
2018-09-07 16:56   ` Kent Overstreet
2018-09-07 17:08   ` Tetsuo Handa
2018-09-07 17:08     ` Tetsuo Handa
2018-09-07 17:50     ` Kent Overstreet
2018-09-07 17:50       ` Kent Overstreet
2018-09-13  2:27       ` Paul Moore
2018-09-13  2:27         ` Paul Moore
2018-09-07 16:56 ` [PATCH 4/6] Generic radix trees Kent Overstreet
2018-09-10 23:18   ` [PATCH] Generic radix tree: add kernel-doc chapter Randy Dunlap
2018-09-07 16:56 ` [PATCH 5/6] proc: commit to genradix Kent Overstreet
2018-09-07 16:56 ` [PATCH 6/6] Drop flex_arrays Kent Overstreet
2018-09-07 18:49   ` Randy Dunlap
2018-12-13 12:30   ` Xin Long
2018-12-13 14:41     ` Matthew Wilcox
2018-12-13 15:51       ` Neil Horman
2018-12-13 16:45         ` Matthew Wilcox
2018-12-13 18:09           ` Neil Horman
2018-12-17 12:50             ` Kent Overstreet
2018-12-18 12:19               ` Neil Horman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-23  1:18 [PATCH 1/6] Generic radix trees Kent Overstreet
2018-05-23  1:18 ` [PATCH 6/6] Drop flex_arrays Kent Overstreet
2018-05-23  1:18   ` Kent Overstreet
     [not found]   ` <20180523011821.12165-6-kent.overstreet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-05-23 13:39     ` Jonathan Corbet
2018-05-23 13:39       ` Jonathan Corbet
2018-05-23 13:39       ` Jonathan Corbet
2018-05-23 17:24     ` Dave Hansen
2018-05-23 17:24       ` Dave Hansen
2018-05-23 17:24       ` Dave Hansen
     [not found]       ` <0fb1b28b-12da-5d2b-2308-283af9fe6ae4-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-05-23 22:06         ` Kent Overstreet
2018-05-23 22:06           ` Kent Overstreet
2018-05-23 22:06           ` Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181218121912.GA2078@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dave.hansen@intel.com \
    --cc=davem@davemloft.net \
    --cc=kent.overstreet@gmail.com \
    --cc=khorenko@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=obabin@virtuozzo.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.