diff mbox

dev-dax: ratelimit unaligned vma warning

Message ID x49po0cgt1r.fsf@segfault.boston.devel.redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Moyer June 27, 2018, 3:14 p.m. UTC
This is easily triggered from userspace, so let's ratelimit the warning.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

Comments

Dan Williams June 27, 2018, 3:18 p.m. UTC | #1
On Wed, Jun 27, 2018 at 8:14 AM, Jeff Moyer <jmoyer@redhat.com> wrote:
> This is easily triggered from userspace, so let's ratelimit the warning.
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
> index de2f8297a210..16ea90615aac 100644
> --- a/drivers/dax/device.c
> +++ b/drivers/dax/device.c
> @@ -196,7 +196,8 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
>
>         mask = dax_region->align - 1;
>         if (vma->vm_start & mask || vma->vm_end & mask) {
> -               dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
> +               dev_info_ratelimited(dev,
> +                               "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
>                                 current->comm, func, vma->vm_start, vma->vm_end,
>                                 mask);

Sure, but any reason to not go ahead and convert all of them?
Jeff Moyer June 27, 2018, 3:29 p.m. UTC | #2
Dan Williams <dan.j.williams@intel.com> writes:

> On Wed, Jun 27, 2018 at 8:14 AM, Jeff Moyer <jmoyer@redhat.com> wrote:
>> This is easily triggered from userspace, so let's ratelimit the warning.
>>
>> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>>
>> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
>> index de2f8297a210..16ea90615aac 100644
>> --- a/drivers/dax/device.c
>> +++ b/drivers/dax/device.c
>> @@ -196,7 +196,8 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
>>
>>         mask = dax_region->align - 1;
>>         if (vma->vm_start & mask || vma->vm_end & mask) {
>> -               dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
>> +               dev_info_ratelimited(dev,
>> +                               "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
>>                                 current->comm, func, vma->vm_start, vma->vm_end,
>>                                 mask);
>
> Sure, but any reason to not go ahead and convert all of them?

I assume you mean "all of the dev_info calls in this function."  If so,
then no, there's no reason--I'll submit an updated patch.  Are there any
other paths you know of with this sort of issue?  I didn't see any on a
quick glance.

-Jeff
Dan Williams June 27, 2018, 3:33 p.m. UTC | #3
On Wed, Jun 27, 2018 at 8:29 AM, Jeff Moyer <jmoyer@redhat.com> wrote:
> Dan Williams <dan.j.williams@intel.com> writes:
>
>> On Wed, Jun 27, 2018 at 8:14 AM, Jeff Moyer <jmoyer@redhat.com> wrote:
>>> This is easily triggered from userspace, so let's ratelimit the warning.
>>>
>>> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>>>
>>> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
>>> index de2f8297a210..16ea90615aac 100644
>>> --- a/drivers/dax/device.c
>>> +++ b/drivers/dax/device.c
>>> @@ -196,7 +196,8 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
>>>
>>>         mask = dax_region->align - 1;
>>>         if (vma->vm_start & mask || vma->vm_end & mask) {
>>> -               dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
>>> +               dev_info_ratelimited(dev,
>>> +                               "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
>>>                                 current->comm, func, vma->vm_start, vma->vm_end,
>>>                                 mask);
>>
>> Sure, but any reason to not go ahead and convert all of them?
>
> I assume you mean "all of the dev_info calls in this function."

Right.

> If so,
> then no, there's no reason--I'll submit an updated patch.  Are there any
> other paths you know of with this sort of issue?  I didn't see any on a
> quick glance.

No, I think this is the only chatty place I can think of.
diff mbox

Patch

diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index de2f8297a210..16ea90615aac 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -196,7 +196,8 @@  static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
 
 	mask = dax_region->align - 1;
 	if (vma->vm_start & mask || vma->vm_end & mask) {
-		dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
+		dev_info_ratelimited(dev,
+				"%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
 				current->comm, func, vma->vm_start, vma->vm_end,
 				mask);
 		return -EINVAL;