All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	kernel test robot <lkp@intel.com>,
	Florian Westphal <fw@strlen.de>,
	stable@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] nft_set_pipapo: Disable preemption before getting per-CPU pointer
Date: Mon, 8 Jun 2020 10:56:52 +0200	[thread overview]
Message-ID: <20200608085652.GP28263@breakpoint.cc> (raw)
In-Reply-To: <45861d795de2db1494b40bb2cc13bb36b4dacf72.1591606165.git.sbrivio@redhat.com>

Stefano Brivio <sbrivio@redhat.com> wrote:
> The lkp kernel test robot reports, with CONFIG_DEBUG_PREEMPT enabled:
[..]

> diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
> index 8b5acc6910fd..8c04388296b0 100644
> --- a/net/netfilter/nft_set_pipapo.c
> +++ b/net/netfilter/nft_set_pipapo.c
> @@ -1242,7 +1242,9 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set,
>  		end += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
>  	}
>  
> -	if (!*this_cpu_ptr(m->scratch) || bsize_max > m->bsize_max) {
> +	if (!*get_cpu_ptr(m->scratch) || bsize_max > m->bsize_max) {
> +		put_cpu_ptr(m->scratch);
> +
>  		err = pipapo_realloc_scratch(m, bsize_max);
>  		if (err)
>  			return err;
> @@ -1250,6 +1252,8 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set,
>  		this_cpu_write(nft_pipapo_scratch_index, false);

Won't that mean that this_cpu_write() can occur on a different CPU than
the get_cpu_ptr() ptr check was done on?

  reply	other threads:[~2020-06-08  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08  8:50 [PATCH nf] nft_set_pipapo: Disable preemption before getting per-CPU pointer Stefano Brivio
2020-06-08  8:56 ` Florian Westphal [this message]
2020-06-08  9:05   ` Stefano Brivio
2020-06-09 21:48 ` Pablo Neira Ayuso

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=20200608085652.GP28263@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=lkp@intel.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=sbrivio@redhat.com \
    --cc=stable@vger.kernel.org \
    /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.