mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [GIT PULL] time namespace fixes for v5.11
Date: Mon, 14 Dec 2020 12:57:44 +0100	[thread overview]
Message-ID: <20201214115744.3306832-1-christian.brauner@ubuntu.com> (raw)

Hi Linus,

Here are some time namespace fixes for v5.11.

/* Summary */
When time namespaces were introduced we missed to virtualize the "btime" field
in /proc/stat. This confuses tasks which are in another time namespace with a
virtualized boottime which is common in some container workloads. This pr
contains Michael's series to fix "btime" which Thomas asked me to take through
my tree.
To fix "btime" virtualization we simply subtract the offset of the time
namespace's boottime from btime before printing the stats. Note that since
start_boottime of processes are seconds since boottime and the boottime stamp
is now shifted according to the time namespace's offset, the offset of the time
namespace also needs to be applied before the process stats are given to
userspace. This avoids that processes shown by tools such as "ps" appear as
time travelers in the corresponding time namespace. Selftests are included to
verify that btime virtualization in /proc/stat works as expected.

The following changes since commit 3cea11cd5e3b00d91caf0b4730194039b45c5891:

  Linux 5.10-rc2 (2020-11-01 14:43:51 -0800)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/time-namespace-v5.11

for you to fetch changes up to 5c62634fc65101d350cbd47722fb76f02693059d:

  namespace: make timens_on_fork() return nothing (2020-11-18 11:06:47 +0100)

/* Testing */
All patches are based on v5.10-rc2. All old and new tests are passing.
Please note that I missed to merge these fixes into my for-next branch and so
linux-next has not contained the commits in this pr.
I'm still sending this pr because these are fairly trivial bugfixes and have
seen vetting from multiple people. I have also now merged this tag into my
for-next branch so these commits will show up in linux-next soon. If you feel
more comfortable with this sitting in linux-next for a while please just ignore
this pr and I'll resend after rc1 has been released.

/* Conflicts */
At the time of creating this PR no merge conflicts were reported from
linux-next and no merge 2c85ebc57b3e ("Linux 5.10").

Please consider pulling these changes from the signed time-namespace-v5.11 tag.

Thanks!
Christian

----------------------------------------------------------------
time-namespace-v5.11

----------------------------------------------------------------
Hui Su (1):
      namespace: make timens_on_fork() return nothing

Michael Weiß (3):
      timens: additional helper functions for boottime offset handling
      fs/proc: apply the time namespace offset to /proc/stat btime
      selftests/timens: added selftest for /proc/stat btime

 fs/proc/array.c                         |  6 ++--
 fs/proc/stat.c                          |  3 ++
 include/linux/time_namespace.h          | 28 ++++++++++++++--
 kernel/nsproxy.c                        |  7 +---
 kernel/time/namespace.c                 |  6 ++--
 tools/testing/selftests/timens/procfs.c | 58 ++++++++++++++++++++++++++++++++-
 6 files changed, 92 insertions(+), 16 deletions(-)

             reply	other threads:[~2020-12-14 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 11:57 Christian Brauner [this message]
2020-12-15  0:49 ` pr-tracker-bot

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=20201214115744.3306832-1-christian.brauner@ubuntu.com \
    --to=christian.brauner@ubuntu.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®