From: Helge Deller <deller@gmx.de>
To: Tom Herbert <tom@herbertland.com>
Cc: Tom Herbert <therbert@google.com>,
"David S. Miller" <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
linux-parisc List <linux-parisc@vger.kernel.org>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
John David Anglin <dave.anglin@bell.net>
Subject: Re: CONFIG_XPS depends on L1_CACHE_BYTES being greater than sizeof(struct xps_map)
Date: Fri, 23 Oct 2015 21:21:52 +0200 [thread overview]
Message-ID: <562A88D0.1010807@gmx.de> (raw)
In-Reply-To: <CALx6S351U9L43Qh88DkJSM4tmhR-7SDoC6bCEhNqxnuu8LqTNA@mail.gmail.com>
On 22.10.2015 23:37, Tom Herbert wrote:
> On Thu, Oct 22, 2015 at 1:00 PM, Helge Deller <deller@gmx.de> wrote:
>> Hi Tom & David,
>>
>> I've queued-up a patch for the parisc architecture which reduces L1_=
CACHE_BYTES from 32 to 16:
>> https://patchwork.kernel.org/patch/7399291/
>>
>> But this change will break the kernel build like this:
>>
>> In file included from net/core/dev.c:92:0:
>> net/core/dev.c: In function =E2=80=98expand_xps_map=E2=80=99:
>> include/linux/netdevice.h:721:27: warning: overflow in implicit cons=
tant conversion [-Woverflow]
>> #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_ma=
p)) \
>> net/core/dev.c:1972:18: note: in expansion of macro =E2=80=98XPS_MIN=
_MAP_ALLOC=E2=80=99
>> int alloc_len =3D XPS_MIN_MAP_ALLOC;
>>
>> Do you see an easy way to fix this ?
>>
> How about
>=20
> #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - ((sizeof(struct xps_map=
)
> % L1_CACHE_BYTES)) \
The full line would then be:
#define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - (sizeof(struct xps_map) % =
L1_CACHE_BYTES)) / sizeof(u16))
The only problem I see with this is, that XPS_MIN_MAP_ALLOC might becom=
e zero.
In that case the call to kzalloc_node() in expand_xps_map() doesn't all=
ocate any memory for the queues.
Helge
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Helge Deller <deller@gmx.de>
To: Tom Herbert <tom@herbertland.com>
Cc: Tom Herbert <therbert@google.com>,
"David S. Miller" <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
linux-parisc List <linux-parisc@vger.kernel.org>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
John David Anglin <dave.anglin@bell.net>
Subject: Re: CONFIG_XPS depends on L1_CACHE_BYTES being greater than sizeof(struct xps_map)
Date: Fri, 23 Oct 2015 21:21:52 +0200 [thread overview]
Message-ID: <562A88D0.1010807@gmx.de> (raw)
In-Reply-To: <CALx6S351U9L43Qh88DkJSM4tmhR-7SDoC6bCEhNqxnuu8LqTNA@mail.gmail.com>
On 22.10.2015 23:37, Tom Herbert wrote:
> On Thu, Oct 22, 2015 at 1:00 PM, Helge Deller <deller@gmx.de> wrote:
>> Hi Tom & David,
>>
>> I've queued-up a patch for the parisc architecture which reduces L1_CACHE_BYTES from 32 to 16:
>> https://patchwork.kernel.org/patch/7399291/
>>
>> But this change will break the kernel build like this:
>>
>> In file included from net/core/dev.c:92:0:
>> net/core/dev.c: In function ‘expand_xps_map’:
>> include/linux/netdevice.h:721:27: warning: overflow in implicit constant conversion [-Woverflow]
>> #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \
>> net/core/dev.c:1972:18: note: in expansion of macro ‘XPS_MIN_MAP_ALLOC’
>> int alloc_len = XPS_MIN_MAP_ALLOC;
>>
>> Do you see an easy way to fix this ?
>>
> How about
>
> #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - ((sizeof(struct xps_map)
> % L1_CACHE_BYTES)) \
The full line would then be:
#define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - (sizeof(struct xps_map) % L1_CACHE_BYTES)) / sizeof(u16))
The only problem I see with this is, that XPS_MIN_MAP_ALLOC might become zero.
In that case the call to kzalloc_node() in expand_xps_map() doesn't allocate any memory for the queues.
Helge
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-10-23 19:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 15:38 [PATCH][RFC] parisc: Change L1_CACHE_BYTES to 16 John David Anglin
2015-09-27 16:07 ` [PATCH v2][RFC] " John David Anglin
2015-09-27 16:17 ` James Bottomley
2015-09-27 16:46 ` John David Anglin
2015-10-15 0:32 ` [PATCH v3] " John David Anglin
2015-10-22 11:38 ` Aw: " Helge Deller
2015-10-22 11:53 ` Helge Deller
2015-10-22 14:35 ` James Bottomley
2015-10-22 14:53 ` John David Anglin
2015-10-22 20:00 ` CONFIG_XPS depends on L1_CACHE_BYTES being greater than sizeof(struct xps_map) Helge Deller
2015-10-22 20:00 ` Helge Deller
2015-10-22 21:37 ` Tom Herbert
2015-10-22 21:37 ` Tom Herbert
2015-10-23 19:21 ` Helge Deller [this message]
2015-10-23 19:21 ` Helge Deller
2015-10-23 22:16 ` Tom Herbert
2015-10-23 22:16 ` Tom Herbert
2015-10-22 21:50 ` Eric Dumazet
2015-10-22 21:50 ` Eric Dumazet
2015-10-23 19:25 ` Helge Deller
2015-10-23 19:25 ` Helge Deller
2015-10-23 20:03 ` Eric Dumazet
2015-10-23 21:08 ` Helge Deller
2015-10-23 21:09 ` Helge Deller
2015-10-23 21:38 ` Eric Dumazet
2015-10-23 22:00 ` Alexander Duyck
2015-10-23 22:17 ` Helge Deller
2015-10-23 22:40 ` Alexander Duyck
2015-10-24 14:43 ` Helge Deller
2015-10-25 5:41 ` Alexander Duyck
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=562A88D0.1010807@gmx.de \
--to=deller@gmx.de \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dave.anglin@bell.net \
--cc=davem@davemloft.net \
--cc=linux-parisc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=tom@herbertland.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 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.