From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755102AbbJIUXA (ORCPT ); Fri, 9 Oct 2015 16:23:00 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:34548 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754799AbbJIUW6 (ORCPT ); Fri, 9 Oct 2015 16:22:58 -0400 Subject: Re: [PATCH v2] tty: fix stall caused by missing memory barrier in drivers/tty/n_tty.c To: Kosuke Tatsukawa References: <17EC94B0A072C34B8DCF0D30AD16044A02871D53@BPXM09GP.gisp.nec.co.jp> <5617F93F.9060408@hurleysoftware.com> Cc: Greg Kroah-Hartman , Jiri Slaby , "linux-kernel@vger.kernel.org" From: Peter Hurley Message-ID: <5618221F.9060205@hurleysoftware.com> Date: Fri, 9 Oct 2015 16:22:55 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5617F93F.9060408@hurleysoftware.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2015 01:28 PM, Peter Hurley wrote: > Tatsukawa-san, > > I would still like to root-cause the reported stall; is the reported > stall resolved if smp_mb() is added before the waitqueue_active() > in __receive_buf()? Nevermind, I see it now. The store to commit_head is deferred until after the load of read_wait->next; a full memory barrier would properly order the store before the load but, since that is roughly equivalent to taking the spin lock for the wake up anyway, it makes sense to just always do the wakeup. Thanks again. Regards, Peter Hurley