linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: alan@wylie.me.uk (Alan J. Wylie)
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Frederic Weisbecker <frederic@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Regression in posix-cpu-timers.c (was Re: Linux 5.14.4)
Date: Wed, 15 Sep 2021 18:45:33 +0100	[thread overview]
Message-ID: <87ilz1pwaq.fsf@wylie.me.uk> (raw)
In-Reply-To: <1631693373201133@kroah.com> (Greg Kroah-Hartman's message of "Wed, 15 Sep 2021 10:09:33 +0200")


Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> I'm announcing the release of the 5.14.4 kernel.

I'm seeing a regression in 5.14.4

Running Nextcloud (a PHP web application) with a PostgreSQL backend

All was fine with 5.14.3

With 5.14.4, Nextcloud hangs loading events/contacts, etc.

As well as the web interface hanging, running this command on the command
line also errors:

# su apache -s /bin/bash -c "cd /var/www/htdocs/nextcloud/ && php occ maintenance:mode --on"
PHP Fatal error:  Maximum execution time of 0 seconds exceeded in
/var/www/htdocs/nextcloud/lib/private/Files/AppData/AppData.php on line 41

# su apache -s /bin/bash -c "cd /var/www/htdocs/nextcloud/ && php occ maintenance:mode --on"
PHP Fatal error:  Maximum execution time of 0 seconds exceeded in
/var/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php on line 65

# su apache -s /bin/bash -c "cd /var/www/htdocs/nextcloud/ && php occ maintenance:mode --on"
PHP Fatal error:  Maximum execution time of 0 seconds exceeded in
/var/www/htdocs/nextcloud/lib/public/Files/SimpleFS/ISimpleRoot.php on line 68

# su apache -s /bin/bash -c "cd /var/www/htdocs/nextcloud/ && php occ maintenance:mode --on"
PHP Fatal error:  Maximum execution time of 0 seconds exceeded in
/var/www/htdocs/nextcloud/apps/theming/lib/ImageManager.php on line 313

Note that the above commands were all run immediately after each other,
but showed up in different php scripts.

Similar errors appear in the Apache log.

After reverting this commit in 5.14.4, Nextcloud resumed working.

$ git revert 564005805aadec9cb7e5dc4e14071b8f87cd6b58

This commit is 406dd42bd1ba0c01babf9cde169bb319e52f6147 in Linus's tree

I'll be more than happy to help with debugging / diagnosing this

The server is running up-to-date Gentoo.

postgres (PostgreSQL) 13.3
PHP 7.4.21 (cli) (built: Jul 11 2021 06:14:49) ( ZTS )
Server version: Apache/2.4.48 (Unix)
Nextcloud 21.0.3

$ git bisect bad
564005805aadec9cb7e5dc4e14071b8f87cd6b58 is the first bad commit
commit 564005805aadec9cb7e5dc4e14071b8f87cd6b58
Author: Frederic Weisbecker <frederic@kernel.org>
Date:   Mon Jul 26 14:55:10 2021 +0200

    posix-cpu-timers: Force next expiration recalc after itimer reset
    
    [ Upstream commit 406dd42bd1ba0c01babf9cde169bb319e52f6147 ]
    
    When an itimer deactivates a previously armed expiration, it simply doesn't
    do anything. As a result the process wide cputime counter keeps running and
    the tick dependency stays set until it reaches the old ghost expiration
    value.
    
    This can be reproduced with the following snippet:
    
            void trigger_process_counter(void)
            {
                    struct itimerval n = {};
    
                    n.it_value.tv_sec = 100;
                    setitimer(ITIMER_VIRTUAL, &n, NULL);
                    n.it_value.tv_sec = 0;
                    setitimer(ITIMER_VIRTUAL, &n, NULL);
            }
    
    Fix this with resetting the relevant base expiration. This is similar to
    disarming a timer.
    
    Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20210726125513.271824-4-frederic@kernel.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 kernel/time/posix-cpu-timers.c | 2 --
 1 file changed, 2 deletions(-)
$ 

$ git bisect log
git bisect start
# bad: [d6f7bb5bb29096b2935c55deeb545616dab74406] Linux 5.14.4
git bisect bad d6f7bb5bb29096b2935c55deeb545616dab74406
# good: [d27a14321366788cef927dbe69854f34460b3f7c] Linux 5.14.3
git bisect good d27a14321366788cef927dbe69854f34460b3f7c
# bad: [203baf2a84d30b468ae80868344e7685b8f4124b] net: dsa: tag_sja1105: optionally build as module when switch driver is module if PTP is enabled
git bisect bad 203baf2a84d30b468ae80868344e7685b8f4124b
# bad: [d031746f556b344d87033bc9dcee1a65dd6a56a3] drm/panfrost: Fix missing clk_disable_unprepare() on error in panfrost_clk_init()
git bisect bad d031746f556b344d87033bc9dcee1a65dd6a56a3
# bad: [115540457feae9a215e5c16e434f71b80860038f] io-wq: remove GFP_ATOMIC allocation off schedule out path
git bisect bad 115540457feae9a215e5c16e434f71b80860038f
# bad: [923c1c5ca5a81958a8bfd891bc16c319c4bb9e6d] nvme-tcp: don't update queue count when failing to set io queues
git bisect bad 923c1c5ca5a81958a8bfd891bc16c319c4bb9e6d
# good: [f02146cf84e6165cae177aea30acdea7b8d76cf3] EDAC/mce_amd: Do not load edac_mce_amd module on guests
git bisect good f02146cf84e6165cae177aea30acdea7b8d76cf3
# bad: [796c0a620178d68900fb2f4bf987cd89a9b38090] udf: Fix iocharset=utf8 mount option
git bisect bad 796c0a620178d68900fb2f4bf987cd89a9b38090
# bad: [0d7541f439be37dabb7546889503d16ac59ec29f] hrtimer: Avoid double reprogramming in __hrtimer_start_range_ns()
git bisect bad 0d7541f439be37dabb7546889503d16ac59ec29f
# bad: [564005805aadec9cb7e5dc4e14071b8f87cd6b58] posix-cpu-timers: Force next expiration recalc after itimer reset
git bisect bad 564005805aadec9cb7e5dc4e14071b8f87cd6b58
# first bad commit: [564005805aadec9cb7e5dc4e14071b8f87cd6b58] posix-cpu-timers: Force next expiration recalc after itimer reset
$

-- 
Alan J. Wylie                                          https://www.wylie.me.uk/

Dance like no-one's watching. / Encrypt like everyone is.
Security is inversely proportional to convenience

  parent reply	other threads:[~2021-09-15 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  8:09 Linux 5.14.4 Greg Kroah-Hartman
2021-09-15  8:09 ` Greg Kroah-Hartman
2021-09-15 17:45 ` Alan J. Wylie [this message]
2021-09-15 18:09   ` Regression in posix-cpu-timers.c (was Re: Linux 5.14.4) Greg Kroah-Hartman
2021-09-15 18:53     ` Alan J. Wylie
2021-09-16  8:51       ` Greg Kroah-Hartman
2021-09-15 18:31   ` Frederic Weisbecker
2021-09-15 18:41     ` Linus Torvalds
2021-09-15 21:15       ` Frederic Weisbecker
2021-09-15 19:20     ` Alan J. Wylie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilz1pwaq.fsf@wylie.me.uk \
    --to=alan@wylie.me.uk \
    --cc=frederic@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).