Re: RFC: small syscons and kbd patch

From: Maksim Yevmenkin <maksim.yevmenkin_at_gmail.com>
Date: Thu, 4 Dec 2008 09:27:08 -0800
On Thu, Dec 4, 2008 at 8:00 AM, Paul B. Mahol <onemda_at_gmail.com> wrote:
> On 12/4/08, Paul B. Mahol <onemda_at_gmail.com> wrote:
>> On 12/4/08, Maksim Yevmenkin <maksim.yevmenkin_at_gmail.com> wrote:
>>> On Thu, Dec 4, 2008 at 3:24 AM, Garrett Cooper <yanefbsd_at_gmail.com> wrote:
>>>> On Tue, Dec 2, 2008 at 5:01 PM, Maksim Yevmenkin
>>>> <maksim.yevmenkin_at_gmail.com> wrote:
>>>>> Dear Hackers,
>>>>>
>>>>> can someone please review the attached small patch for syscons and
>>>>> kbd? it should be a no-op mostly. the patch basically does
>>>>>
>>>>> 1) removes bogus layering in syscons, i.e. basically removes
>>>>> sccngetch();
>>>>> 2) implements advisory lock for kbd (based on atomic(9));
>>>>> 3) implements new POLLED flag for kbd;
>>>>>
>>>>> this is a part of a plan to fix keyboard access races in syscons.
>>>>>
>>>>> thanks,
>>>>> max
>>>>
>>>> Max,
>>>>     Why are you double and triple negating on this line?
>>>>
>>>> +       return (atomic_cmpset_acq_int(&kbd->kb_locked, !!!on, !!on));
>>>
>>> the idea was to ensure that kbd->kb_locked variable only takes values
>>> 0 (zero) and 1 (one).
>>>
>>> thanks,
>>> max
>>> _______________________________________________
>>> freebsd-current_at_freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-current
>>> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>>>
>>
>> Maybe it is usefull to report, maybe not.
>>
>> I'm experiencing keyboard (atkbd) death now and then when inside Xorg once
>> Xorg is started in following (racey) way:
>>
>> alias onlyx             "/usr/local/bin/xinit -- -nolisten tcp -br & &&
>> exit"
>>
>> and /etc/csh.logout:
>>
>> echo $TERM | grep cons25 >> /dev/null && clear && vidcontrol -C
>>
>> I will test it and report if it fix my "problem".
>
> No luck.

sorry, but the patch was not really intended to fix anything yet. it
was just a small bit.

> Typing blindly I managed to panic from kdb, and I got only this:
>
> KDB: enter: manual escape to debugger
> panic: from debugger
> cpuid = 1
> KDB: stack backtrace:
> panic: bufwrite: buffer is not busy???

this looks like it came from ffs_bufwrite() in ufs/ffs/ffs_vfsops.c

> cpuid = 1
> KDB: enter: panic
> exclusive sleep mutex Giant (Giant) r = 1 (0xc0725a70) locked _at_ /usr/src/sys/dev
> /syscons/syscons.c:618
>

can you please setup a serial console and reproduce the panic?

thanks
max
Received on Thu Dec 04 2008 - 16:27:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:38 UTC