Re: [PATCH 10/14] netvm: Set PF_MEMALLOC as appropriate during SKB processing

From: Michał Mirosław
Date: Thu Jun 09 2011 - 08:28:48 EST


2011/6/9 Mel Gorman <mgorman@xxxxxxx>:
> On Thu, Jun 09, 2011 at 12:21:31PM +0200, Micha? Miros?aw wrote:
>> 2011/6/9 Mel Gorman <mgorman@xxxxxxx>:
>> [...]
>> > +/*
>> > + * Limit which protocols can use the PFMEMALLOC reserves to those that are
>> > + * expected to be used for communication with swap.
>> > + */
>> > +static bool skb_pfmemalloc_protocol(struct sk_buff *skb)
>> > +{
>> > + Â Â Â switch (skb->protocol) {
>> > + Â Â Â case __constant_htons(ETH_P_ARP):
>> > + Â Â Â case __constant_htons(ETH_P_IP):
>> > + Â Â Â case __constant_htons(ETH_P_IPV6):
>> > + Â Â Â case __constant_htons(ETH_P_8021Q):
>> > + Â Â Â Â Â Â Â return true;
>> > + Â Â Â default:
>> > + Â Â Â Â Â Â Â return false;
>> > + Â Â Â }
>> > +}
>>
>> This is not needed and wrong. Whatever list there will be, it's going
>> to always miss some obscure setup (or not that obscure, like
>> ATAoverEthernet).
>>
>
> NBD is updated in the series to set the socket information
> appropriately but the same cannot be said of AoE. The necessary
> changes have been made IPv4 and IPv6 to handle pfmemalloc sockets
> but the same cannot be necessarily said for the other protocols. Yes,
> the check could be removed but leaving it there makes a clear statement
> on what scenario can be reasonably expected to work.

Ok. Then the comment before skb_pfmemalloc_protocol() is misleading.
It should say that this is a list of protocols which implement the
required special handling of PFMEMALLOC skbs.

Best Regards,
MichaÅ MirosÅaw
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/