[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iK3nsoWOxE5X0afcyCEuab57v5jrKn-b5ZwNO3njO_7pQ@mail.gmail.com>
Date: Thu, 9 Jun 2022 08:43:46 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Neal Cardwell <ncardwell@...gle.com>
Cc: Shakeel Butt <shakeelb@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev <netdev@...r.kernel.org>,
Soheil Hassas Yeganeh <soheil@...gle.com>,
Wei Wang <weiwan@...gle.com>
Subject: Re: [PATCH net-next 4/7] net: implement per-cpu reserves for memory_allocated
On Thu, Jun 9, 2022 at 8:09 AM Neal Cardwell <ncardwell@...gle.com> wrote:
> Yes, sorry about that. In parallel Soheil just pointed out to me OOB
> that the code is correct because at that point in the code we know
> that local_reserve is negative...
>
> Sorry for the noise!
No worries Neal, I made the same mistake when writing the function :)
Once we determined the new pcpu reserve X is out-of-range (-1MB ..
+1MB) we have to transfer it to shared memory_allocated
Regardless of the value X, the transfert is the same regardless of
initial raise/decrease intent :
pcpu_reserve -= X; // using this_cpu op which is IRQ safe
memory_reserve += X; // using atomic op, IRQ and SMP safe
Powered by blists - more mailing lists