All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ed Cashin <ecashin@coraid.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] aoe: improve handling of misbehaving network paths
Date: Tue, 4 Dec 2012 15:39:12 -0800	[thread overview]
Message-ID: <20121204153912.2e6b4d2f.akpm@linux-foundation.org> (raw)
In-Reply-To: <f7df7cd5fe1a303debe7cbf086853663e3c59366.1354501189.git.ecashin@coraid.com>

On Mon, 3 Dec 2012 20:40:55 -0500
Ed Cashin <ecashin@coraid.com> wrote:

> An AoE target can have multiple network ports used for AoE, and
> in the aoe driver, those are tracked by the aoetgt struct.  These
> changes allow the aoe driver to handle network paths, or aoetgts,
> that are not working well, compared to the others.
> 
> Paths that do not get responses despite the retransmission of AoE
> commands are marked as "tainted", and non-tainted paths are
> preferred.
> 
> Meanwhile, the aoe driver attempts to "probe" the tainted path in
> the background by issuing reads of LBA 0 that are padded out to
> full (possibly jumbo-frame) size.  If the probes get responses,
> then the path is "redeemed", and its taint is removed.
> 
> This mechanism has been shown to be helpful in transparently
> handling and recovering from real-world network "brown outs" in
> ways that the earlier "shoot the help-needing target in the head"
> mechanism could not.
> 
>
> ...
>
> +static void
> +ata_rw_frameinit(struct frame *f)
> +{
> +	struct aoetgt *t;
> +	struct aoe_hdr *h;
> +	struct aoe_atahdr *ah;
> +	struct sk_buff *skb;
> +	char writebit, extbit;
> +
> +	skb = f->skb;
> +	h = (struct aoe_hdr *) skb_mac_header(skb);
> +	ah = (struct aoe_atahdr *) (h + 1);

Well.  It would be neater to have a

struct whatever {
	struct aoe_hdr hdr;
	struct aoe_atahdr atahdr;
};

> +	skb_put(skb, sizeof(*h) + sizeof(*ah));
> +	memset(h, 0, skb->len);
> +
> +	writebit = 0x10;
> +	extbit = 0x4;
> +
>
> ...
>
> @@ -462,11 +488,14 @@ resend(struct aoedev *d, struct frame *f)
>  	h = (struct aoe_hdr *) skb_mac_header(skb);
>  	ah = (struct aoe_atahdr *) (h+1);
>  
> -	snprintf(buf, sizeof buf,
> -		"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
> -		"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
> -		h->src, h->dst, t->nout);
> -	aoechr_error(buf);
> +	if (!(f->flags & FFL_PROBE)) {
> +		snprintf(buf, sizeof(buf),
> +			"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
> +			"retransmit", d->aoemajor, d->aoeminor,
> +			f->tag, jiffies, n,
> +			h->src, h->dst, t->nout);
> +		aoechr_error(buf);

Could use kasprintf() here.  That avoids the fixed-size local buffer
and avoids the GFP_ATOMIC allocation and copy in aoechr_error().

> +	}
>  
>  	f->tag = n;
>  	fhash(f);
>
> ...
>
>  aoecmd_init(void)
>  {
> +	void *p;
> +
> +	/* get_zeroed_page returns page with ref count 1 */
> +	p = (void *) get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);
> +	if (!p)
> +		return -ENOMEM;
> +	empty_page = virt_to_page(p);

Could use alloc_pages() and remove `p' and the virt_to_page().

Why is __GFP_REPEAT used?  I don't think this __init function is more
important than all the other ones in the kernel?


>  	INIT_LIST_HEAD(&iocq.head);
>  	spin_lock_init(&iocq.lock);
>  	init_waitqueue_head(&ktiowq);
>
> ...
>


  reply	other threads:[~2012-12-04 23:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1354501189.git.ecashin@coraid.com>
2012-12-04  1:40 ` [PATCH 1/7] aoe: improve handling of misbehaving network paths Ed Cashin, Ed Cashin
2012-12-04 23:39   ` Andrew Morton [this message]
2012-12-06 16:12     ` Ed Cashin
2012-12-04  1:42 ` [PATCH 2/7] aoe: avoid races between device destruction and discovery Ed Cashin, Ed Cashin
2012-12-04 23:45   ` Andrew Morton
2012-12-06 16:16     ` Ed Cashin
2012-12-04  1:44 ` [PATCH 3/7] aoe: use dynamic number of remote ports for AoE storage target Ed Cashin, Ed Cashin
2012-12-04  1:46 ` [PATCH 4/7] aoe: allow user to disable target failure timeout Ed Cashin, Ed Cashin
2012-12-04  1:48 ` [PATCH 5/7] aoe: allow comma separator in aoe_iflist value Ed Cashin, Ed Cashin
2012-12-04  1:50 ` [PATCH 6/7] aoe: identify source of runt AoE packets Ed Cashin, Ed Cashin
2012-12-04  1:53 ` [PATCH 7/7] aoe: update internal version number to 81 Ed Cashin, Ed Cashin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121204153912.2e6b4d2f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ecashin@coraid.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.