Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1666552

Re: [PATCH v2 1/2] libsas: Don't process sas events in static works

From wangyijing <wangyijing@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] libsas: Don't process sas events in static works
Date 2017-06-15 10:30 +0200
Message-ID <tSyk9-5P-13@gated-at.bofh.it> (permalink)
References (2 earlier) <tScjE-2Yp-13@gated-at.bofh.it> <tSctk-3h2-19@gated-at.bofh.it> <tSgdz-5BT-3@gated-at.bofh.it> <tSxHr-85z-7@gated-at.bofh.it> <tSy0P-8r5-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



在 2017/6/15 16:00, John Garry 写道:
> On 15/06/2017 08:37, wangyijing wrote:
>>
>>
>> 在 2017/6/14 21:08, John Garry 写道:
>>> On 14/06/2017 10:04, wangyijing wrote:
>>>>>>  static void notify_ha_event(struct sas_ha_struct *sas_ha, enum ha_event event)
>>>>>>>>  {
>>>>>>>> +    struct sas_ha_event *ev;
>>>>>>>> +
>>>>>>>>      BUG_ON(event >= HA_NUM_EVENTS);
>>>>>>>>
>>>>>>>> -    sas_queue_event(event, &sas_ha->pending,
>>>>>>>> -            &sas_ha->ha_events[event].work, sas_ha);
>>>>>>>> +    ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
>>>>>>>> +    if (!ev)
>>>>>>>> +        return;
>>>>>> GFP_ATOMIC allocations can fail and then no events will be queued *and* we
>>>>>> don't report the error back to the caller.
>>>>>>
>>>> Yes, it's really a problem, but I don't find a better solution, do you have some suggestion ?
>>>>
>>>
>>> Dan raised an issue with this approach, regarding a malfunctioning PHY which spews out events. I still don't think we're handling it safely. Here's the suggestion:
>>> - each asd_sas_phy owns a finite-sized pool of events
>>> - when the event pool becomes exhausted, libsas stops queuing events (obviously) and disables the PHY in the LLDD
>>> - upon attempting to re-enable the PHY from sysfs, libsas first checks that the pool is still not exhausted
>>>
>>> If you cannot find a good solution, then let us know and we can help.
>>
>> Hi John and Dan, what's event you found on malfunctioning PHY, if the event is PORTE_BROADCAST_RCVD, since
>> every PORTE_BROADCAST_RCVD libsas always call sas_revalidate_domain(), what about keeping a broadcast waiting(not queued in workqueue)
>> and discard others. If the event is other types, things may become knotty.
>>
> 
> As I mentioned in the v1 series discussion, I found a poorly connected expander PHY was spewing out PHY up and loss of signal events continuously. This is the sort of situation we should protect against. Current solution is ok, as it uses a static event per port/PHY/HA.
> 
> The point is that we cannot allow a PHY to continuously send events to libsas, which may lead to memory exhaustion.

The current solution won't introduce memory exhaustion, but it's not ok, since the root of this issue is it may lost event which is normal.
If we cannot identify the abnormal PHY, I think your mem pool idea is a candidate solution.

> 
> John
> 
>>
>>>
>>> John
>>>
>>>
>>> .
>>>
>>
>>
>> .
>>
> 
> 
> 
> .
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] Enhance libsas hotplug feature Yijing Wang <wangyijing@huawei.com> - 2017-06-14 09:40 +0200
  [PATCH v2 1/2] libsas: Don't process sas events in static works Yijing Wang <wangyijing@huawei.com> - 2017-06-14 09:40 +0200
    Re: [PATCH v2 1/2] libsas: Don't process sas events in static works Johannes Thumshirn <jthumshirn@suse.de> - 2017-06-14 11:00 +0200
      Re: [PATCH v2 1/2] libsas: Don't process sas events in static works wangyijing <wangyijing@huawei.com> - 2017-06-14 11:10 +0200
        Re: [PATCH v2 1/2] libsas: Don't process sas events in static works Johannes Thumshirn <jthumshirn@suse.de> - 2017-06-14 11:30 +0200
          Re: [PATCH v2 1/2] libsas: Don't process sas events in static works wangyijing <wangyijing@huawei.com> - 2017-06-14 11:40 +0200
        Re: [PATCH v2 1/2] libsas: Don't process sas events in static works John Garry <john.garry@huawei.com> - 2017-06-14 15:10 +0200
          Re: [PATCH v2 1/2] libsas: Don't process sas events in static works wangyijing <wangyijing@huawei.com> - 2017-06-15 09:50 +0200
            Re: [PATCH v2 1/2] libsas: Don't process sas events in static works John Garry <john.garry@huawei.com> - 2017-06-15 10:10 +0200
              Re: [PATCH v2 1/2] libsas: Don't process sas events in static works wangyijing <wangyijing@huawei.com> - 2017-06-15 10:30 +0200
  [PATCH v2 2/2] libsas: Enhance libsas hotplug Yijing Wang <wangyijing@huawei.com> - 2017-06-14 09:40 +0200
    Re: [PATCH v2 2/2] libsas: Enhance libsas hotplug Johannes Thumshirn <jthumshirn@suse.de> - 2017-06-14 11:00 +0200
      Re: [PATCH v2 2/2] libsas: Enhance libsas hotplug wangyijing <wangyijing@huawei.com> - 2017-06-14 11:20 +0200

csiph-web