Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 12:30:31 -0500
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        David DEMELIER <demelier.david@gmail.com>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>, John Baldwin <jhb@freebsd.org>, Giovanni Trematerra <giovanni.trematerra@gmail.com>, avg@freebsd.org, Attilio Rao <attilio@freebsd.org>, kib@freebsd.org, Rui Paulo <rpaulo@freebsd.org>, jkim@freebsd.org
Subject:   Re: Kernel panic when unpluggin AC adaptor
Message-ID:  <AANLkTimjGgFF7ZPrOvoKpq5lpKptgItokTZUGdJC1MBN@mail.gmail.com>
In-Reply-To: <AANLkTilysocGoT8HVgwTZF02rSr_5JUdlwkFDUSAc1-l@mail.gmail.com>
References:  <g2mb3954bba1005031436g77215426n83ce7904e5ef321@mail.gmail.com> <AANLkTikUzurYQE7-tDNT-Sd9DaeSp2YLGwUXoupkvQSV@mail.gmail.com> <AANLkTinJuPX9CLW5RRYF8Xh8vX7uKacU9BpmX5uuFuxw@mail.gmail.com> <201006110818.27366.jhb@freebsd.org> <AANLkTilysocGoT8HVgwTZF02rSr_5JUdlwkFDUSAc1-l@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 12, 2010 at 12:19 PM, David DEMELIER
<demelier.david@gmail.com> wrote:
> 2010/6/11 John Baldwin <jhb@freebsd.org>:
>> On Friday 11 June 2010 6:27:48 am Giovanni Trematerra wrote:
>>> On Thu, Jun 10, 2010 at 10:58 PM, Giovanni Trematerra
>>> <giovanni.trematerra@gmail.com> wrote:
>>> > On Tue, May 4, 2010 at 6:35 PM, David DEMELIER <demelier.david@gmail.=
com>
>> wrote:
>>> >> Good news ! It worked, check the picture here :
>>> >>
>>> >> http://img63.imageshack.us/img63/4244/dsc00361g.jpg
>>> >>
>>> >
>>> > Into the file sys/dev/acpica/acpi_cpu.c at the end of acpi_cpu_notify
>>> > (a per cpu notification handler), called when _CST objects changing,
>>> > global cpu_cx_count is set to the greatest value of all sc->cpu_cx_co=
unt
>>> > per-cpu variables. That could result in a panic as David reported,
>>> > because that lets to invoke acpi_cpu_global_cx_lowest_sysctl from
>>> > /etc/rc.d/power_profile, when AC adapter is unplugged, =A0with a valu=
e
>>> > that not all the CPUs could handle in the acpi_cpu_idle.
>>> > The patch also change global cpu_cx_lowest according to new value of
>>> > global cpu_cx_count if needed.
>>> >
>>> > David Demelier made a great work to test every patch I sent him
>>> > to identify the source of the problem.
>>> >
>>> > Please, let me know your comments and possibly commit the patch
>>> > if you think is good enough.
>>>
>>> As jhb@ pointed me out in private with the previous patch a CPU could
>>> never enter in the
>>> lowest Cx-state even if it gained.
>>> So I'd like to propose this new solution.
>>> When hw.acpi.cpu.cx_lowest sysctl is set, the global handler in
>>> sys/dev/acpi_cpu.c
>>> will set the greatest sc->cpu_cx_lowest value supported by the CPU and
>>> not the same
>>> value for all CPUs.
>>> Later, when CPU, possibly gain new Cx-states, the acpi_cpu_notify
>>> handler will set
>>> sc->cpu_cx_lowest accordingly with global cx_lowest and the Cx-states
>>> supported by
>>> the CPU.
>>>
>>> Now I think that /etc/rc.d/power_profile script has a problem but that
>>> is a different story.
>>> The script select the lowest_value only querying cx-states of the dev.c=
pu.0.
>>> If different CPUs may have different Cx-states, the script should use
>>> as lowest_value the
>>> lowest value between all the CPUs.
>>
>> Yes.
>>
>>> Please, let me know your comments and possibly commit the patch
>>> if you think is good enough.
>>
>> I think this is a good compromise for now.
>>
>> --
>> John Baldwin
>>
>
> Thanks for Giovanni's patience and work, he made a lot of research to
> solve this little problem :-).
>
> Is there a chance that this patch appears in 8.1-RELEASE ?
>
> Kind regards.
>
> --
> Demelier David
>

Someone would have to discuss with the Release Engineering team, but
it would be cool :)

-Brandon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimjGgFF7ZPrOvoKpq5lpKptgItokTZUGdJC1MBN>