On Tue, Apr 20, 2021 at 03:57:07PM +0200, Michal Hocko wrote:
> On Tue 20-04-21 14:24:30, Matthew Wilcox wrote:
> > On Tue, Apr 20, 2021 at 03:13:54PM +0300, Mike Rapoport wrote:
> > > Add a paragraph that explains that it may happen that the counters in
> > > /proc/meminfo do not add up to the ove
Taking address of a function argument directly works just fine.
Signed-off-by: Alexey Dobriyan
---
include/linux/netlink.h | 12
1 file changed, 4 insertions(+), 8 deletions(-)
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -129,23 +129,19 @@ struct
This file has been effectively empty since 2.3.99-pre3 !
Signed-off-by: Alexey Dobriyan
---
drivers/atm/fore200e.c |1 -
drivers/atm/suni.c |1 -
include/linux/atm_suni.h | 12
3 files changed, 14 deletions(-)
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm
misc stuff).
Not compile tested on csky, hexagon, nds32, openrisc.
Love,
Alexey
Signed-off-by: Alexey Dobriyan
#!/bin/sh -x
find . -type f -name '*.h' -print |\
LC_ALL=C sort |\
sed -e 's#^./##g' |\
xargs ./script
>From 251ca5673886b5bb0a42004944290b9d2b267a4a Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan
Date: Fri, 19 Feb 2021 13:37:24 +0300
Subject: [PATCH 10/11] pragma once: delete few backslashes
Some macros contain one backslash too many and end up being the last
macro in a header file. When #pra
>From c17ac63e1334c742686cd411736699c1d34d45a7 Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan
Date: Wed, 10 Feb 2021 21:07:45 +0300
Subject: [PATCH 01/11] pragma once: delete include/linux/atm_suni.h
This file has been empty since 2.3.99-pre3!
Delete it instead of converting to #pragma o
On Thu, Jan 21, 2021 at 06:44:54PM -0800, Jakub Kicinski wrote:
> On Fri, 22 Jan 2021 01:07:39 +0300 Alexey Dobriyan wrote:
> > My name is Alexey and I've tried to use IDE for kernel development.
> >
> > QT Creator segfaults while parsing ibmvnic.c which is annoying as
hide the offending code.
https://bugzilla.redhat.com/show_bug.cgi?id=1886548
Signed-off-by: Alexey Dobriyan
---
fix modular case
drivers/net/ethernet/ibm/ibmvnic.c |3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmv
hide the offending code.
https://bugzilla.redhat.com/show_bug.cgi?id=1886548
Signed-off-by: Alexey Dobriyan
---
drivers/net/ethernet/ibm/ibmvnic.c |3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -5080,6 +5
On Sat, Aug 15, 2020 at 11:42:10PM +0100, Al Viro wrote:
> On Sat, Aug 15, 2020 at 11:23:43AM -0700, Pascal Bouchareine wrote:
> > Let caller specify allocation.
> > Preserve existing calls with GFP_USER.
>
> Bloody bad idea, unless you slap a BUG_ON(flags & GFP_ATOMIC) on it,
> to make sure nobod
On Fri, Jun 19, 2020 at 11:37:47AM -0700, Linus Torvalds wrote:
> On Thu, Jun 18, 2020 at 2:06 PM Alexey Dobriyan wrote:
> >
> > Rename
> > struct notifier_block *this
> > to
> > struct notifier_block *nb
> >
> > "nb" is argua
25.c
Both gcc and g++ accept new name. It would make my adventure of carrying
linux++ patchset slightly less miserable.
Signed-off-by: Alexey Dobriyan
---
arch/alpha/kernel/setup.c|2 +-
arch/mips/kernel/pm-cps.c|2 +-
arch/mips/s
This function returns string literals which are "const char *".
Signed-off-by: Alexey Dobriyan
---
net/core/sock.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3493,7 +3493,7 @@ static long sock_prot_memory_allocated(st
This function is only used via function pointer.
"inline" doesn't hurt given that taking address of an inline function
forces out-of-line version but it doesn't help either.
Signed-off-by: Alexey Dobriyan
---
net/ipv4/igmp.c |2 +-
1 file changed, 1 insertion(+), 1 de
If IPsec is not configured, there is no reason to delay the inevitable.
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |7 ---
net/ipv4/udp.c |2 ++
2 files changed, 2 insertions(+), 7 deletions(-)
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1613,13 +1613,6
Some ints are "enum sock_flags" in fact.
Signed-off-by: Alexey Dobriyan
---
include/net/sock.h |2 +-
net/core/sock.c|5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2512,7 +2512,7 @@ static inline bool s
error: pointer of type 'void *' used
in arithmetic [-Werror=pointer-arith]
Those are theoretical probably but kernel doesn't control compiler flags
in userspace.
Signed-off-by: Alexey Dobriyan
---
include/uapi/linux/netfilter_arp/arp_tables.h |2 +-
include/uapi/lin
Use more pleasant looking
struct notifier_block *nb,
instead of "this".
Signed-off-by: Alexey Dobriyan
---
drivers/net/bonding/bond_main.c |2 +-
drivers/net/ethernet/broadcom/cnic.c |2 +-
drivers/net/ethernet/chelsio/cxgb4/cx
Delete long obsoleted "register" keyword.
Signed-off-by: Alexey Dobriyan
---
drivers/net/ethernet/apple/bmac.c |4 ++--
drivers/net/slip/slhc.c | 30 +++---
net/netfilter/ipvs/ip_vs_ctl.c|4 ++--
net/netfilter/ipvs/ip_vs_lblcr.c |
On Sun, Jul 07, 2019 at 02:03:20AM +0100, Al Viro wrote:
> On Sat, Jul 06, 2019 at 07:52:02PM +0300, Alexey Dobriyan wrote:
> > +struct proc_dir_entry *_proc_mkdir(const char *name, umode_t mode,
> > + struct proc_dir_entry **parent, void *data)
ned-off-by: "Hallsmark, Per"
Signed-off-by: Alexey Dobriyan
---
drivers/net/bonding/bond_procfs.c |2 +-
net/core/pktgen.c |2 +-
net/ipv4/netfilter/ipt_CLUSTERIP.c |2 +-
net/ipv6/proc.c|2 +-
net/netfilter/xt_hashlimit.c |4
quot; line.
[redid original patch --adobriyan]
Reported-by: "Hallsmark, Per"
Signed-off-by: Alexey Dobriyan
---
fs/proc/generic.c | 25 ++---
fs/proc/internal.h |3 +++
fs/proc/proc_net.c | 17 +
include/li
Return code should be formally "netdev_tx_t".
Signed-off-by: Alexey Dobriyan
---
include/linux/netdevice.h |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4373,7 +4373,7 @@ static inline netdev_tx_t netdev_
On Sun, May 06, 2018 at 06:45:31PM +0100, Al Viro wrote:
> On Sun, May 06, 2018 at 08:19:49PM +0300, Alexey Dobriyan wrote:
> > @@ -62,9 +62,9 @@ struct proc_dir_entry {
> > umode_t mode;
> > u8 namelen;
> > #ifdef CONFIG_64BIT
> > -#define SI
On Wed, Apr 25, 2018 at 05:47:47PM +0200, Christoph Hellwig wrote:
> Changes since V1:
> - open code proc_create_data to avoid setting not fully initialized
>entries live
> - use unsigned int for state_size
Need this to maintain sizeof(struct proc_dir_entry):
Otherwise ACK fs/proc/ part.
d
On Tue, Apr 24, 2018 at 06:06:53PM +0200, Christoph Hellwig wrote:
> On Tue, Apr 24, 2018 at 08:19:16AM -0700, Andrew Morton wrote:
> > > > I want to ask if it is time to start using poorman function overloading
> > > > with _b_c_e(). There are millions of allocation functions for example,
> > > >
> git://git.infradead.org/users/hch/misc.git proc_create
I want to ask if it is time to start using poorman function overloading
with _b_c_e(). There are millions of allocation functions for example,
all slightly difference, and people will add more. Seeing /proc interfaces
doubled like this
On Thu, Apr 19, 2018 at 02:41:04PM +0200, Christoph Hellwig wrote:
> Variant of proc_create_data that directly take a struct seq_operations
> --- a/fs/proc/internal.h
> +++ b/fs/proc/internal.h
> @@ -45,6 +45,7 @@ struct proc_dir_entry {
> const struct inode_operations *proc_iops;
> co
On Thu, Apr 19, 2018 at 02:41:15PM +0200, Christoph Hellwig wrote:
> Variant of proc_create_data that directly take a seq_file show
> +struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode,
> + struct proc_dir_entry *parent,
> + int (*show)(struct seq
On Thu, Apr 19, 2018 at 02:41:03PM +0200, Christoph Hellwig wrote:
> Variants of proc_create{,_data} that directly take a struct seq_operations
> argument and drastically reduces the boilerplate code in the callers.
> +static int proc_seq_open(struct inode *inode, struct file *file)
> +{
> + s
If kmem case sizes are 32-bit, then usecopy region should be too.
Cc: netdev@vger.kernel.org
Signed-off-by: Alexey Dobriyan
---
include/linux/slab.h | 2 +-
include/linux/slab_def.h | 4 ++--
include/linux/slub_def.h | 4 ++--
include/net/sock.h | 4 ++--
mm/slab.h| 4
Kmem caches aren't relocated once set up.
Signed-off-by: Alexey Dobriyan
---
net/xfrm/xfrm_input.c |3 ++-
net/xfrm/xfrm_policy.c |2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -9,6 +9,7 @@
*/
#in
All kmem caches aren't reallocated once set up.
Signed-off-by: Alexey Dobriyan
---
net/core/net_namespace.c |2 +-
net/core/skbuff.c|4 ++--
net/ipv4/fib_trie.c |5 +++--
net/ipv4/inetpeer.c |3 ++-
net/ipv4/ipmr.c |3 ++-
net/soc
/* Don't dirty result unless string is valid MAC. */
> for (i = 0; i < ETH_ALEN; i++) {
> if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
Short string will bail in the loop, indeed.
Reviewed-by: Alexey Dobriyan
On Mon, Jan 15, 2018 at 02:18:00PM -0800, Stephen Hemminger wrote:
> On Tue, 16 Jan 2018 00:42:40 +0300
> Alexey Dobriyan wrote:
>
> > /proc has been ignoring struct file_operations::owner field for 10 years.
> > Specifically, it started with commit
> > 786d7e1612f0b
->i_fop = &proc_reg_file_ops;
+ else
+ inode->i_fop = de->proc_fops;
+ }
VFS stopped pinning module at this point.
Signed-off-by: Alexey Dobriyan
---
net/8021q/vlanproc.c |2 --
On Mon, Jan 15, 2018 at 02:50:12PM -0500, David Miller wrote:
> From: Alexey Dobriyan
> Date: Sat, 13 Jan 2018 20:11:52 +0300
>
> > /proc has been ignoring struct file_operations::owner field for ages.
> >
> > Signed-off-by: Alexey Dobriyan
>
> What, then, mak
/proc has been ignoring struct file_operations::owner field for ages.
Signed-off-by: Alexey Dobriyan
---
net/8021q/vlanproc.c |2 --
net/appletalk/aarp.c |1 -
net/appletalk/atalk_proc.c |3 ---
net/atm/br2684.c |1 -
net
dst_dev_put 104 99 -5
xfrm_lookup 20272021 -6
update_or_create_fnhe 13391329 -10
Signed-off-by: Alexey Dobriyan
---
include/net/dst.h | 8
net/core/dst.c
66 61 -5
Signed-off-by: Alexey Dobriyan
---
include/net/dst.h | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/net/dst.h b/include/net/dst.h
index 0f0905bda423..25decfa4e14a 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -31,7
Typedef dst->flags for checking with sparse.
Signed-off-by: Alexey Dobriyan
---
drivers/net/vrf.c | 2 +-
include/net/dst.h | 23 ---
include/net/ip6_route.h | 2 +-
net/core/dst.c | 4 ++--
net/ipv6/route.c| 4 ++--
5 files changed,
> - BUG_ON(!list_empty(grace_list));
> + WARN_ONCE(!list_empty(grace_list),
> + "net %x %s: grace_list is not empty\n",
> + net->ns.inum, __func__);
* printing __func__ is unnecessary as it will be on top of the stacktrace
anyway,
* message duplicates condition
function old new delta
sysfs_slab_add 720 719 -1
...
check_object 699 676 -23
Signed-off-by: Alexey Dobriyan
---
include/linux/slab
Add sparse-checked slab_flags_t for struct kmem_cache::flags
(SLAB_POISON, etc).
SLAB is bloated temporarily by switching to "unsigned long",
but only temporarily.
Signed-off-by: Alexey Dobriyan
---
fs/ecryptfs/main.c |2 -
fs/xfs/kmem.h|2 -
include/lin
nfp_port_get_phys_port_name 180 170 -10
Signed-off-by: Alexey Dobriyan
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c|2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c|2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |2 +-
drivers/net
ff-by: Alexey Dobriyan
---
drivers/net/bonding/bond_main.c |3 ++-
include/linux/if_arp.h |2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2491,7 +2491,8 @@ int bond_arp_rcv(const struct sk_buff
t_get 11041103 -1
__pneigh_lookup 69 68 -1
__neigh_create 24522451 -1
Signed-off-by: Alexey Dobriyan
---
drivers/net/ethernet/chelsio/cxgb4/l2t.c |4 ++--
includ
_iter152 151 -1
clip_ioctl 14751474 -1
clip_constructor 93 92 -1
__neigh_create 24552452 -3
Signed-off-by: Alexey Dobriyan
---
in
ate unsignedness and flip some "int" to "unsigned int" as well.
This is preparation to switching nlmsg_new() to "unsigned int".
Signed-off-by: Alexey Dobriyan
---
net/xfrm/xfrm_user.c | 44 +++-
1 file changed, 23 insertions(+
y_esn 349 337 -12
xfrm_replay_notify_bmp 345 333 -12
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |2 +-
net/xfrm/xfrm_user.c | 10 +-
2 files changed, 6 insertions(+), 6 deletions(-)
--- a/include/net/xfrm.h
+++ b/includ
Key lengths can't be negative.
Comparison with nla_len() is left signed just in case negative value
can sneak in there.
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |2 +-
net/xfrm/xfrm_user.c |2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/net/x
Key lengths can't be negative.
Comparison with nla_len() is left signed just in case negative value
can sneak in there.
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |2 +-
net/xfrm/xfrm_user.c |2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/net/x
Key lengths can't be negative.
Comparison with nla_len() is left signed just in case negative value
can sneak in there.
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |2 +-
net/xfrm/xfrm_user.c |2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/net/x
-off-by: Alexey Dobriyan
---
net/core/dev.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7989,7 +7989,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv,
const char *name,
unsigned int txqs, unsigned int rxqs
> Global function ipv6_rcv_saddr_equal and static functions
> ipv6_rcv_saddr_equal and ipv4_rcv_saddr_equal currently return int.
>
> bool is slightly more descriptive for these functions so change
> their return type from int to bool.
>From code generation POV "int" is better for non-inlined func
[CC trimmed]
On Tue, Aug 15, 2017 at 10:12:16PM -0400, Chris Mi wrote:
> IDR uses internally radix tree which uses unsigned long. It doesn't
> makes sense to have index as signed value.
It doesn't. But it makes sense to use "unsigned int" because it
generates smaller code on x86_64.
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int
> type, void *data,
> space -= data_len;
> - if (space > 0)
> - memset(opt, 0, space);
> +
> + memset(opt, 0, space);
This can't be right.
A
This field is sizeof of corresponding kmem_cache so it can't be negative.
Space will be saved after 32-bit kmem_cache_create() patch.
Signed-off-by: Alexey Dobriyan
---
include/net/request_sock.h |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/net/request_sock.h
This field is sizeof of corresponding kmem_cache so it can't be negative.
Prepare for 32-bit kmem_cache_create().
Signed-off-by: Alexey Dobriyan
---
include/net/inet_frag.h |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/net/inet_frag.h
+++ b/include/net/inet_f
30523045 -7
callforward_do_filter659 651 -8
dst_gc_task 571 549 -22
Signed-off-by: Alexey Dobriyan
---
include/net/dst.h |2 +-
1 file changed, 1 insertion(+), 1 deletion
810 799 -11
transmit 719 698 -21
Signed-off-by: Alexey Dobriyan
---
drivers/net/wan/hdlc_raw_eth.c |3 ++-
include/linux/netdevice.h |2 +-
net/core/net-sysfs.c |8 ++--
net/core/rtnetlink.c
On Mon, Apr 10, 2017 at 5:43 PM, Eric Dumazet wrote:
> On Mon, 2017-04-10 at 11:07 +0300, Alexey Dobriyan wrote:
>> struct skb_shared_info {
>> - unsigned short _unused;
>> unsigned char nr_frags;
>> __u8tx_flags;
>> u
169 164 -5
ether_setup 148 143 -5
Signed-off-by: Alexey Dobriyan
---
include/linux/netdevice.h |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
h_output 14131409 -4
ip_finish_output2 16271623 -4
Signed-off-by: Alexey Dobriyan
---
include/linux/netdevice.h |3 +--
include/net/neighbour.h |4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
--- a
ned-off-by: Alexey Dobriyan
---
include/linux/skbuff.h |1 -
1 file changed, 1 deletion(-)
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -413,7 +413,6 @@ struct ubuf_info {
* the end of the header data, ie. at skb->end.
*/
struct skb_shared_info {
- unsigned s
> struct skb_shared_info {
> + unsigned short _unused;
> unsigned char nr_frags;
This makes _all_ fields to be accessed with offset, but if you move
padding down, at least ->nr_frags will enjoy clean and simple [R64]
addressing.
On allyesconfig-ish kernel:
before: +542 = 72
On Mon, Apr 3, 2017 at 4:56 PM, Craig Gallek wrote:
> On Sun, Apr 2, 2017 at 6:18 PM, Alexey Dobriyan wrote:
>> Number of sockets is limited by 16-bit, so 64-bit allocation will never
>> happen.
>>
>> 16-bit ops are the worst code density-wise on x86_64 because of
>
old new delta
reuseport_add_sock 539 536 -3
Signed-off-by: Alexey Dobriyan
---
net/core/sock_reuseport.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -13,9 +13,9
Make ->hash_count, ->low_watermark and ->high_watermark unsigned int
and propagate unsignedness to other variables.
This change doesn't change code generation because these fields aren't
used in 64-bit contexts but make it anyway: these fields can't be
negative numbers
flow_cache_flush_tasklet 362 365 +3
__flow_cache_shrink 333 336 +3
flow_cache_cpu_up_prep 178 171 -7
flow_cache_lookup 11591148 -11
Signed-off-by: A
che_lookup 11631159 -4
CSWTCH 75997 75953 -44
Signed-off-by: Alexey Dobriyan
---
include/net/flow.h |2 +-
net/core/flow.c|6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/include/net/flow.h
+++ b/include/
On Mon, Mar 27, 2017 at 1:37 PM, Steffen Klassert
wrote:
> On Sat, Mar 25, 2017 at 07:41:17PM +0300, Alexey Dobriyan wrote:
>> After (no branches):
>>
>> movr8d,0x20
>> movrdx,0x
>> movesi,DWORD PTR [rsi+0x2c]
>
esi,DWORD PTR [rbx]
movrdi,rdx
xoreax,eax
shlrdi,cl
bswap edi
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -845,9 +845,9 @@
On Fri, Mar 24, 2017 at 05:16:44PM +, David Laight wrote:
> From: Alexey Dobriyan
> > Sent: 23 March 2017 23:33
> > Current addr4_match() code has special test for /0 prefixes because of
> > standard required undefined behaviour. However, it is possible to omit
>
,DWORD PTR [rbx]
movrdi,rdx
xoreax,eax
shlrdi,cl
bswap edi
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |5 +
1 file changed, 5 insertions(+)
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -844,10 +844,15 @@ static inlin
xfrm_state_walk 708 696 -12
xfrm_selector_match 918 906 -12
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/include/net/xfrm.h
+++
xfrm_hash_resize27522743 -9
policy_hash_bysel985 973 -12
policy_hash_direct 1036 999 -37
Signed-off-by: Alexey Dobriyan
---
net/xfrm/xfrm_hash.h |4 ++--
1 file changed, 2 insertions(+), 2
Signed-off-by: Alexey Dobriyan
---
include/net/xfrm.h |1 -
net/key/af_key.c |1 -
net/xfrm/xfrm_user.c |1 -
3 files changed, 3 deletions(-)
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -586,7 +586,6 @@ struct xfrm_migrate {
struct xfrm_mgr {
struct
Converting IPv4 address doesn't need 64-bit arithmetic.
Space savings: 10 bytes!
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10 (-10)
function old new delta
in_aton96 86 -10
Signed-off-by: A
On Wed, Mar 22, 2017 at 5:09 AM, David Miller wrote:
> From: Alexey Dobriyan
> Date: Mon, 20 Mar 2017 01:27:43 +0300
>
>> ->hash_rnd_recalc is only used in boolean context.
>>
>> Space savings on x86_64 come from the fact that "MOV rm8, imm8" is
>>
On Sun, Mar 19, 2017 at 04:13:41PM -0700, Eric Dumazet wrote:
> On Mon, 2017-03-20 at 01:24 +0300, Alexey Dobriyan wrote:
> > Hash size can't negative so "unsigned int" is logically correct.
>
>
> > struct flow_cache_percpu *fcp = per_cpu_ptr(fc->p
Make ->hash_count, ->low_watermark and ->high_watermark unsigned int
and propagate unsignedness to other variables.
This doesn't change code generation because these fields aren't used
in 64-bit contexts but make it anyway: these fields can't be negative
numbers.
Signed
chg -0.00%
Signed-off-by: Alexey Dobriyan
---
include/net/flowcache.h |2 +-
net/core/flow.c |6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/include/net/flowcache.h
+++ b/include/net/flowcache.h
@@ -10,7 +10,7 @@ struct flow_cache_percpu {
: Before=170822884, After=170822872, chg -0.00%
Lookup becomes smaller and this is what matters.
Signed-off-by: Alexey Dobriyan
---
net/core/flow.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -47,7 +47,7 @@ struct flow_flus
che_lookup 11631159 -4
CSWTCH 75553 75509 -44
Total: Before=170822932, After=170822884, chg -0.00%
Signed-off-by: Alexey Dobriyan
---
include/net/flow.h |2 +-
net/core/flow.c|6 +++---
2 files changed, 4 insert
On Thu, Jan 26, 2017 at 1:18 PM, SF Markus Elfring
wrote:
> - pctx = kmalloc(sizeof(struct pdp_ctx), GFP_KERNEL);
> + pctx = kmalloc(sizeof(*pctx), GFP_KERNEL);
The rule about "sizeof(*p)" style of allocation is bogus and should be
abolished.
Rationale says that
> The alternati
On Tue, Dec 13, 2016 at 5:42 PM, David Laight wrote:
> From: Alexey Dobriyan
>> Sent: 13 December 2016 14:23
> ...
>> Well, the point of the patch is to save .text, so might as well save
>> as much as possible. Any form other than "ptr[id]" is going
>> to b
Commit 4f7df337fe79bba1e4c2d525525d63b5ba186bbd
"netlink: 2-clause nla_ok()" is BROKEN.
First clause tests if "->nla_len" could even be accessed at all,
it can not possibly be omitted.
Signed-off-by: Alexey Dobriyan
---
include/net/netlink.h |3 ++-
1 file chan
On Wed, Dec 7, 2016 at 1:49 PM, David Laight wrote:
> From: Alexey Dobriyan
>> Sent: 05 December 2016 14:48
>> On Mon, Dec 5, 2016 at 3:49 PM, David Laight wrote:
>> > From: Alexey Dobriyan
>> >> Sent: 02 December 2016 01:22
>> >> net_generic() f
nla->nla_len >= sizeof(*nla) &&
nla->nla_len <= remaining;
Those logical ands ensure that memory access is not done
if "rem" is small enough to even fetch ->nla_len.
Maybe someone could vouch that other checks prevent
this kind of situation from happening but not me.
How very embarrassing.
Signed-off-by: Alexey Dobriyan
On Mon, Dec 5, 2016 at 3:49 PM, David Laight wrote:
> From: Alexey Dobriyan
>> Sent: 02 December 2016 01:22
>> net_generic() function is both a) inline and b) used ~600 times.
>>
>> It has the following code inside
>>
>>
nfsd4_lock 38513796 -55
tipc_mon_rcv1012 956 -56
Total: Before=156643951, After=156639743, chg -0.00%
Signed-off-by: Alexey Dobriyan
---
include/net/netns/generic.h | 16
6 -82
nl80211_parse_sched_scan28892780-109
ip_tun_from_nlattr 30862945-141
Signed-off-by: Alexey Dobriyan
---
include/net/netlink.h |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/include/net/netlink.h
+++ b/includ
This is precursor to fixing "[id - 1]" bloat inside net_generic().
Name "s" is chosen to complement name "u" often used for dummy unions.
Signed-off-by: Alexey Dobriyan
---
include/net/netns/generic.h |6 --
net/core/net_namespace.c|8
ult is to preallocate 13 pointers which
is actually quite a lot. You need IPv6, netfilter, bridging etc together
loaded to trigger reallocation in the first place. Trimmed down
config are OK.
Signed-off-by: Alexey Dobriyan
---
net/core/net_namespace.c | 10 +-
1 file cha
On Wed, Nov 23, 2016 at 3:49 PM, David Laight wrote:
> From: Alexey Dobriyan
>> Sent: 19 November 2016 01:08
> ...
>> - for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--)
>> + for (i = skb_shinfo(skb)->nr_frags - 1; (int)i >= 0; i--)
&
-1
ip_do_fragment 25492548 -1
ip6_fragment31303128 -2
Total: Before=154865032, After=154865028, chg -0.00%
Signed-off-by: Alexey Dobriyan
---
include/linux/skbuff.h |6 +++---
net/ipv4/ip_
Total: Before=154865051, After=154865032, chg -0.00%
Signed-off-by: Alexey Dobriyan
---
lib/nlattr.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -14,7 +14,7 @@
#include
#include
-static const u16 nla_attr_minlen[NLA_TYPE_MAX+1
721659 -13
nl80211_parse_sched_scan29022888 -14
nl80211_trigger_scan17381720 -18
do_execute_actions 28212738 -83
Total: Before=154865355, After=154865051, chg -0.00%
Signed-off-b
__kfree_skb_flush 56 53 -3
__kfree_skb_defer 97 92 -5
Total: Before=154865639, After=154865629, chg -0.00%
Signed-off-by: Alexey Dobriyan
---
net/core/skbuff.c |2 +-
1 file changed, 1 insertion
1 - 100 of 266 matches
Mail list logo