From: Erik H. <eri...@er...> - 2015-01-16 11:51:20
|
On Mon, Jan 05, 2015 at 06:11:45PM +0100, Jon Maloy wrote: > > #define MAX_BEARERS 2 > > This has already been extended to 8 upstream. > You will have a conflict. No it's still 2 there. > > +void tipc_udp_send(struct work_struct *work) { > > + struct msghdr msg; > > + struct kvec iov; > > + struct sk_buff *skb; > > + struct udp_skb_parms *parms; > > + struct udp_bearer *ub; > > + int err; > > + > > + ub = container_of(work, struct udp_bearer, tx_work); > > + memset(&msg, 0, sizeof(struct msghdr)); > > + while (!list_empty(&ub->txq)) { > > + spin_lock_bh(&ub->txq_lock); > > + parms = list_first_entry(&ub->txq, struct udp_skb_parms, > > next); > > Same objection as for the previous version: dynamic allocations on the > critical data path should be avoided. Why not use TIPC_SKB_CB for this, > as I suggested? Fixed, thanks. > > +/** > > + * tipc_send_msg - enqueue a send request > > + * > > + * The send request need to be deferred since we cannot call kernel > > + * socket API functions while holding the node spinlock. > > + */ > > Yes. Unfortunately this is necessary for now, but we should aim at > releasing the node spinlock before sending the buffers, on all > bearers. This will probably have some positive impact on performance. > What's holding me from sending another version now is the skb reallocation from kernel_sendmsg(). On lowmem systems this is causing the kworker thread to spin heavily on memory allocation because it has run out of memory in the kmalloc-2048 pool. It should be possible to reuse the TIPC skb and pass that to the IP stack, but i don't know exactly how to do this. //E |