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: <CAF=yD-J0XAYMyoaaN1jEmarE6p_T0RPMmD8OYRFNcHw7ZVjBNQ@mail.gmail.com>
Date:   Tue, 6 Mar 2018 20:02:13 -0500
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Sowmini Varadhan <sowmini.varadhan@...cle.com>
Cc:     Network Development <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Santosh Shilimkar <santosh.shilimkar@...cle.com>
Subject: Re: [PATCH net-next 2/2] rds: use list structure to track information
 for zerocopy completion notification

On Tue, Mar 6, 2018 at 10:22 AM, Sowmini Varadhan
<sowmini.varadhan@...cle.com> wrote:
> Commit 401910db4cd4 ("rds: deliver zerocopy completion notification
> with data") removes support fo r zerocopy completion notification
> on the sk_error_queue, thus we no longer need to track the cookie
> information in sk_buff structures.
>
> This commit removes the struct sk_buff_head rs_zcookie_queue by
> a simpler list that results in a smaller memory footprint as well
> as more efficient memory_allocation time.
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@...cle.com>

Acked-by: Willem de Bruijn <willemb@...gle.com>

>  static void rds_rm_zerocopy_callback(struct rds_sock *rs,
>                                      struct rds_znotifier *znotif)
>  {
> -       struct sk_buff *skb, *tail;
> -       unsigned long flags;
> -       struct sk_buff_head *q;
> +       struct rds_msg_zcopy_info *info;
> +       struct rds_msg_zcopy_queue *q;
>         u32 cookie = znotif->z_cookie;
>         struct rds_zcopy_cookies *ck;
> +       struct list_head *head;
> +       unsigned long flags;
>
> +       mm_unaccount_pinned_pages(&znotif->z_mmp);
>         q = &rs->rs_zcookie_queue;
>         spin_lock_irqsave(&q->lock, flags);
> -       tail = skb_peek_tail(q);
> -
> -       if (tail && skb_zcookie_add(tail, cookie)) {
> -               spin_unlock_irqrestore(&q->lock, flags);
> -               mm_unaccount_pinned_pages(&znotif->z_mmp);
> -               consume_skb(rds_skb_from_znotifier(znotif));
> -               /* caller invokes rds_wake_sk_sleep() */
> -               return;
> +       head = &q->zcookie_head;
> +       if (!list_empty(head)) {
> +               info = list_entry(head, struct rds_msg_zcopy_info,
> +                                 rs_zcookie_next);
> +               if (info && rds_zcookie_add(info, cookie)) {

small nit: the test for info will always succeed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ