lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30c39b36-a7c4-6214-4265-2df5546c0025@oracle.com>
Date:   Wed, 16 Sep 2020 14:25:25 -0700
From:   santosh.shilimkar@...cle.com
To:     Manjunath Patil <manjunath.b.patil@...cle.com>
Cc:     netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
        aruna.ramakrishna@...cle.com, rama.nichanamatlu@...cle.com
Subject: Re: [PATCH 1/1] net/rds: suppress page allocation failure error in
 recv buffer refill

On 9/16/20 2:15 PM, Manjunath Patil wrote:
> Hi Santosh,
> 
> inline.
> On 9/16/2020 12:27 PM, santosh.shilimkar@...cle.com wrote:
>> On 9/16/20 12:08 PM, Manjunath Patil wrote:
>>> RDS/IB tries to refill the recv buffer in softirq context using
>>> GFP_NOWAIT flag. However alloc failure is handled by queueing a work to
>>> refill the recv buffer with GFP_KERNEL flag. This means failure to
>>> allocate with GFP_NOWAIT isn't fatal. Do not print the PAF warnings if
>>> softirq context fails to refill the recv buffer, instead print a one
>>> line warning once a day.
>>>
>>> Signed-off-by: Manjunath Patil <manjunath.b.patil@...cle.com>
>>> Reviewed-by: Aruna Ramakrishna <aruna.ramakrishna@...cle.com>
>>> ---
>>>   net/rds/ib_recv.c | 16 +++++++++++++---
>>>   1 file changed, 13 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
>>> index 694d411dc72f..38d2894f6bb2 100644
>>> --- a/net/rds/ib_recv.c
>>> +++ b/net/rds/ib_recv.c
>>> @@ -310,8 +310,8 @@ static int rds_ib_recv_refill_one(struct 
>>> rds_connection *conn,
>>>       struct rds_ib_connection *ic = conn->c_transport_data;
>>>       struct ib_sge *sge;
>>>       int ret = -ENOMEM;
>>> -    gfp_t slab_mask = GFP_NOWAIT;
>>> -    gfp_t page_mask = GFP_NOWAIT;
>>> +    gfp_t slab_mask = gfp;
>>> +    gfp_t page_mask = gfp;
>>>         if (gfp & __GFP_DIRECT_RECLAIM) {
>>>           slab_mask = GFP_KERNEL;
>>> @@ -406,6 +406,16 @@ void rds_ib_recv_refill(struct rds_connection 
>>> *conn, int prefill, gfp_t gfp)
>>>           recv = &ic->i_recvs[pos];
>>>           ret = rds_ib_recv_refill_one(conn, recv, gfp);
>>>           if (ret) {
>>> +            static unsigned long warn_time;
>> Comment should start on next line.
> I will add new line. checkpatch.pl didn't find it though.
>>> +            /* warn max once per day. This should be enough to
>>> +             * warn users about low mem situation.
>>> +             */
>>> +            if (printk_timed_ratelimit(&warn_time,
>>> +                           24 * 60 * 60 * 1000))
>>> +                pr_warn("RDS/IB: failed to refill recv buffer for 
>>> <%pI6c,%pI6c,%d>, waking worker\n",
>>> +                    &conn->c_laddr, &conn->c_faddr,
>>> +                    conn->c_tos);
>> Didn't notice this before.
>> Why not just use "pr_warn_ratelimited()" ?
> I think you meant, get rid of if clause and use "pr_warn_ratelimited()" 
> instead.
> That can still produce more than needed logs during low memory situation.
> 
Try it out. It will do the same job as what you are trying to do.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ