From nobody Mon Mar 6 03:58:49 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PVPvp72r4z3wMPC for ; Mon, 6 Mar 2023 03:59:02 +0000 (UTC) (envelope-from manav1811kumar@gmail.com) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PVPvp1M7fz3L1j; Mon, 6 Mar 2023 03:59:02 +0000 (UTC) (envelope-from manav1811kumar@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62e.google.com with SMTP id a2so8867942plm.4; Sun, 05 Mar 2023 19:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678075140; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RvWoDtWX5zylj3IuyQ1K22nO+WYSD6M7Iknqv43DtpU=; b=XJ12U6VqkBv9XMxGMIdRb0J1E/Yk47W6AI+MSZtzTPcfFlPSaUrkZYibqHZboi6p9q PMKXjPnxiBySxS5wHTQqE9nYe1K9VrDqJOg7px7YKycAQAcp0qXqhsX+GMQyphf8lnLU t3h4oEi3rHmBrw8wjwNOhyGYlCW58Vq5oaHTe6mnj0WAPPh3WJcPmHnrYnL+H+TNScXl Oa0y1+B/B2q5VZCECwU7XnNsHZAPEo5tNTEKum1ji5T5TypZ2ImErHTBVADYl/iRVaWB sPldXmRQWdZz+MPQ+cffGtcJGCbghXe2PMTl1s4y2Borq1uCUsg3hF/kP1TmLgk49pg/ +TJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678075140; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RvWoDtWX5zylj3IuyQ1K22nO+WYSD6M7Iknqv43DtpU=; b=TBWG+xnz2Br0r8jlYMAPmI87ihABMdSo6Bknc0oNK1kLSYE/bA9tx8Og7puMpOOf5i iJF7RpR+bueK7CnLjJ+9jBdL3YGFsKGCiUmjl2JvdK/rDocAMoGD2iVVpFXsMyOVFBuE vyu5zKRNRnWvz1jp6ZHruL7lDRKsJj3TETEI5O3sgGrBjAxDFqpKMJOEpCTQOz43o/jy fd/P64fHqTXo7va5IIcj5rHaB/aYI9We0QhMONtDx1h81ixmm9wEOrJnxBsP3f3q+yfD 6ujoxInn7FzC8N/6zF6EEkWFOCW120/xN8yhe+xGaUlyv3sSOj4Va3QgYIhvoOY6aecz m/TQ== X-Gm-Message-State: AO0yUKW5E3Kv/bgKQllz6wGUcbX2IWMbUjx686IyblRLt+irB2p37Q5v 6UP3pQKcZizSOlUIZiidB357jo7HBgi2xCnzIcNCZ07v X-Google-Smtp-Source: AK7set/yA/KpaiLO0oemw7GyO1+f7R6/TgqLnZzWV0EQFowNtDpQjgGkaKM3Yr8l9ekQehOZG0trNXy11vINkkyQfJE= X-Received: by 2002:a17:90b:1917:b0:23a:3636:f0af with SMTP id mp23-20020a17090b191700b0023a3636f0afmr3457979pjb.9.1678075140460; Sun, 05 Mar 2023 19:59:00 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: MANAV KUMAR Date: Mon, 6 Mar 2023 09:28:49 +0530 Message-ID: Subject: Re: acpi_cmbat with charge-limited battery To: Warner Losh Cc: Kyle Evans , FreeBSD Hackers Content-Type: multipart/alternative; boundary="000000000000a754c405f63350f8" X-Rspamd-Queue-Id: 4PVPvp1M7fz3L1j X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000a754c405f63350f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Pls Unsubscribe me from this emailing list. Thanks On Mon, 6 Mar 2023 at 09:03, Warner Losh wrote: > > > On Sun, Mar 5, 2023 at 7:20=E2=80=AFPM Kyle Evans wr= ote: > >> Hello! >> >> I've dealt with this mainly over the weekend, but my solution was to >> just disable acpi_cmbat entirely, which is maybe not the best solution >> but I can't tell if this should be considered a firmware bug or if >> it's something we could find a way to workaround in the kernel. >> >> Basically, I've set the firmware on my frame.work laptop to limit the >> battery charge to 80%. When it hits 80% while plugged in, things get a >> little funky- I assume it's because the firmware's trying to carefully >> maintain the limit, but I end up getting (at least) one acpi >> notification per second, alternating between BST_CHANGE/BIX_CHANGE, >> which in turn drives up CPU usage as we tap it out to devd and upowerd >> picks it up. upowerd ends up pegging a core consistently. >> >> Should we be rate-limiting these devd notifications? Is this even >> reasonable behavior for the firmware? I'm not really sure how other OS >> behave here, but I haven't really seen any complaints from other >> framework'ers. >> > > Seems like this is crappy firmware behavior and we should rate > limit in the driver... It's not useful information to be sharing once > a second... > > Warner > --000000000000a754c405f63350f8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Pls Unsubscribe me from this emailing list.
Thanks

On Mon, 6 Mar 2023 at 09:03, Warner Losh <imp@bsdimp.com> wrote:


On Sun, Mar 5, 20= 23 at 7:20=E2=80=AFPM Kyle Evans <kevans@freebsd.org> wrote:
Hello!

I've dealt with this mainly over the weekend, but my solution was to just disable acpi_cmbat entirely, which is maybe not the best solution
but I can't tell if this should be considered a firmware bug or if
it's something we could find a way to workaround in the kernel.

Basically, I've set the firmware on my frame.work laptop to limit the
battery charge to 80%. When it hits 80% while plugged in, things get a
little funky- I assume it's because the firmware's trying to carefu= lly
maintain the limit, but I end up getting (at least) one acpi
notification per second, alternating between BST_CHANGE/BIX_CHANGE,
which in turn drives up CPU usage as we tap it out to devd and upowerd
picks it up. upowerd ends up pegging a core consistently.

Should we be rate-limiting these devd notifications? Is this even
reasonable behavior for the firmware? I'm not really sure how other OS<= br> behave here, but I haven't really seen any complaints from other
framework'ers.

Seems like this is c= rappy firmware behavior and we should rate
limit in the driver...= It's not useful information to be sharing once
a second...

Warner
--000000000000a754c405f63350f8--