public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <Bart.VanAssche@sandisk.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: for-4.12/block branch
Date: Fri, 21 Apr 2017 11:12:59 -0600	[thread overview]
Message-ID: <5e6c31e1-1176-178e-5af3-7bf6aa46a7c4@kernel.dk> (raw)
In-Reply-To: <b57a4bf4-5c70-8c10-476c-105907b09510@kernel.dk>

On 04/21/2017 11:07 AM, Jens Axboe wrote:
> On 04/21/2017 11:05 AM, Bart Van Assche wrote:
>> On Fri, 2017-04-21 at 10:56 -0600, Jens Axboe wrote:
>>> On 04/21/2017 10:48 AM, Jens Axboe wrote:
>>>> I wonder if it's an imbalance in the preempt count. Looking at it, it
>>>> looks like we're not clearing the alloc data. But I would think that
>>>> would potentially cause much worse problems, but maybe we got lucky?
>>>>
>>>> Let me generate a cleanup patch for that.
>>>
>>> Something like the below.
>>> [ ... ]
>>> +static inline void blk_mq_init_alloc_data(struct blk_mq_alloc_data *data,
>>> +					  unsigned int flags)
>>> +{
>>> +	data->q = NULL;
>>> +	data->flags = flags;
>>> +	data->shallow_depth = 0;
>>> +	data->ctx = NULL;
>>> +	data->hctx = NULL;
>>> +}
>>
>> Hello Jens,
>>
>> Maybe I'm overlooking something but I don't see how this patch can make
>> a difference since the compiler zero-initializes struct members that have
>> not been mentioned explicitly as designated initializers? A common way
>> to zero-initialize a struct is as follows:
>>
>> struct <struct_name> <variable_name> = { };
> 
> Maybe my memory is bad, but we're explicitly setting flags, but not doing
> a zero fill after that.
> 
> 	struct foo foo { .member = bla };
> 
> vs
> 
> 	struct foo foo { .member = bla, };
> 
> But you must be right, because this would barf all over the place with stack
> garbage otherwise. I'll double check I get the same generated code here...

It is of course me smoking crack. I think my recollection dates back to some
bug gcc had in that area, either with suboptimal fill/init, or just not doing
it. In any case, the current code is fine, which is good.

-- 
Jens Axboe

  reply	other threads:[~2017-04-21 17:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 15:32 for-4.12/block branch Bart Van Assche
2017-04-21 16:25 ` Jens Axboe
2017-04-21 16:31   ` Bart Van Assche
2017-04-21 16:33     ` Jens Axboe
2017-04-21 16:40       ` Bart Van Assche
2017-04-21 16:48         ` Jens Axboe
2017-04-21 16:56           ` Jens Axboe
2017-04-21 17:05             ` Bart Van Assche
2017-04-21 17:07               ` Jens Axboe
2017-04-21 17:12                 ` Jens Axboe [this message]
2017-04-21 17:39                 ` Bart Van Assche
2017-04-21 17:53                   ` Jens Axboe

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=5e6c31e1-1176-178e-5af3-7bf6aa46a7c4@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=linux-block@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox