On Tue, Mar 6, 2018 at 10:22 AM, Sowmini Varadhan <sowmini.varad...@oracle.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.varad...@oracle.com>
Acked-by: Willem de Bruijn <will...@google.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.