public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>, "Luck, Tony" <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Lin, Jing" <jing.lin@intel.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	"Kumar, Sanjay K" <sanjay.k.kumar@intel.com>,
	"Dey, Megha" <megha.dey@intel.com>,
	"Pan, Jacob jun" <jacob.jun.pan@intel.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	"hpa@zytor.com" <hpa@zytor.com>
Subject: Re: [PATCH RFC 01/14] x86/asm: add iosubmit_cmds512() based on movdir64b CPU instruction
Date: Wed, 20 Nov 2019 17:27:37 -0700	[thread overview]
Message-ID: <9504173f-29b5-40a6-3fa8-4bfd498e2e31@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1911210120410.29534@nanos.tec.linutronix.de>



On 11/20/19 5:22 PM, Thomas Gleixner wrote:
> On Wed, 20 Nov 2019, Luck, Tony wrote:
>> On Wed, Nov 20, 2019 at 10:53:39PM +0100, Borislav Petkov wrote:
>>> On Wed, Nov 20, 2019 at 02:23:49PM -0700, Dave Jiang wrote:
>>>> +static inline void iosubmit_cmds512(void __iomem *dst, const void *src,
>>>> +				    size_t count)
>>>
>>> An iosubmit function which returns void and doesn't tell its callers
>>> whether it succeeded or not? That looks non-optimal to say the least.
>>
>> That's the underlying functionality of the MOVDIR64B instruction. A
>> posted write so no way to know if it succeeded. When using dedicated
>> queues the caller must keep count of how many operations are in flight
>> and not send more than the depth of the queue.
>>
>>> Why isn't there a fallback function which to call when the CPU doesn't
>>> support movdir64b?
>>
>> This particular driver has no option for fallback. Descriptors can
>> only be submitted with MOVDIR64B (to dedicated queues ... in later
>> patch series support for shared queues will be added, but those require
>> ENQCMD or ENQCMDS to submit).
>>
>> The driver bails out at the beginning of the probe routine if the
>> necessary instructions are not supported:
>>
>> +       /*
>> +        * If the CPU does not support write512, there's no point in
>> +        * enumerating the device. We can not utilize it.
>> +        */
>> +       if (!cpu_has_write512())
>> +               return -ENXIO;
>>
>> Though we should always get past that as this PCI device ID shouldn't
>> every appear on a system that doesn't have the support. Device is on
>> the die, not a plug-in card.
> 
> Then the condition in the iosubmit function is just prone to silently paper
> over any bug in a driver:
> 
>> +       if (!cpu_has_write512())
>> +               return;
> 
> This should at least issue a WARN_ON_ONCE()

Thanks! I'll be adding the WARN_ON_ONCE() for the cap check. Also with 
the alignment check Borislav mentioned, I'll add a WARN_ON() for failures.


> 
> Thanks,
> 
> 	tglx
> 

  reply	other threads:[~2019-11-21  0:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 21:23 [PATCH RFC 00/14] idxd driver for Intel Data Streaming Accelerator Dave Jiang
2019-11-20 21:23 ` [PATCH RFC 01/14] x86/asm: add iosubmit_cmds512() based on movdir64b CPU instruction Dave Jiang
2019-11-20 21:50   ` Dave Hansen
2019-11-20 23:46     ` Dave Jiang
2019-11-20 21:53   ` Borislav Petkov
2019-11-20 23:19     ` Luck, Tony
2019-11-20 23:26       ` Borislav Petkov
2019-11-21  0:15         ` Luck, Tony
2019-11-21  0:27         ` Dan Williams
2019-11-21  0:53           ` Thomas Gleixner
2019-11-21  1:32             ` Dan Williams
2019-11-21 10:37               ` Borislav Petkov
2019-11-21  0:21       ` Dan Williams
2019-11-21  0:22       ` Thomas Gleixner
2019-11-21  0:27         ` Dave Jiang [this message]
2019-11-21  0:10     ` Dave Jiang
2019-11-21 10:59       ` Borislav Petkov
2019-11-21 16:52         ` Dave Jiang
2019-11-22  8:59           ` Borislav Petkov
2019-11-22 17:20             ` Dan Williams
2019-11-22 18:44               ` Borislav Petkov
2019-11-22 18:50                 ` Dan Williams
2019-11-20 21:23 ` [PATCH RFC 02/14] dmaengine: break out channel registration Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 03/14] dmaengine: add new dma device registration Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 04/14] mm: create common code from request allocation based from blk-mq code Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 05/14] dmaengine: add dma_request support functions Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 06/14] dmaengine: add dma request submit and completion path support Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 07/14] dmaengine: update dmatest to support dma request Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 08/14] dmaengine: idxd: Init and probe for Intel data accelerators Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 09/14] dmaengine: idxd: add configuration component of driver Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 10/14] dmaengine: idxd: add descriptor manipulation routines Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 11/14] dmaengine: idxd: connect idxd to dmaengine subsystem Dave Jiang
2019-11-20 21:24 ` [PATCH RFC 12/14] dmaengine: request submit optimization Dave Jiang
2019-11-20 21:25 ` [PATCH RFC 13/14] dmaengine: idxd: add char driver to expose submission portal to userland Dave Jiang
2019-11-20 21:25 ` [PATCH RFC 14/14] dmaengine: idxd: add sysfs ABI for idxd driver Dave Jiang

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=9504173f-29b5-40a6-3fa8-4bfd498e2e31@intel.com \
    --to=dave.jiang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ashok.raj@intel.com \
    --cc=axboe@kernel.dk \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=jing.lin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=megha.dey@intel.com \
    --cc=mingo@redhat.com \
    --cc=sanjay.k.kumar@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vkoul@kernel.org \
    --cc=yi.l.liu@intel.com \
    /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