[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF=yD-Jv1-KfE32jCrAHL8mPnXHRzU4idV7dQYdGtzUcikrWQA@mail.gmail.com>
Date: Sun, 20 May 2018 19:07:01 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: DaeRyong Jeong <threeearcat@...il.com>
Cc: David Miller <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Byoungyoung Lee <byoungyoung@...due.edu>,
Kyungtae Kim <kt0755@...il.com>, bammanag@...due.edu
Subject: Re: WARNING in __static_key_slow_dec
>
> -static void sock_disable_timestamp(struct sock *sk, unsigned long flags)
> +static void sock_disable_timestamp(struct sock *sk, unsigned long flag)
> {
> - if (sk->sk_flags & flags) {
> - sk->sk_flags &= ~flags;
> - if (sock_needs_netstamp(sk) &&
> - !(sk->sk_flags & SK_FLAGS_TIMESTAMP))
> - net_disable_timestamp();
> - }
> + unsigned long prev;
> +
> + do {
> + prev = READ_ONCE(sk->sk_flags);
> +
> + if (!(prev & flag))
> + return;
> +
> + if (cmpxchg(&sk->sk_flags, prev, prev & ~flag) == prev)
> + break;
> + } while (1);
and this can just use set_mask_bits
Powered by blists - more mailing lists