New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 740438 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Linux kernel update cause zRam api problem.

Project Member Reported by chungsheng@google.com, Jul 10 2017

Issue description

Chrome Version: 61.0.3154.0
Chrome OS kernel version 3.18

Function base::GetSwapInfo bug.

Due to the Linux kernel zram change:
https://github.com/torvalds/linux/commit/c87d1655c29500b459fb135258a93f8309ada9c7

This function cannot get the swap information from /sys/block/zram<id>/* anymore.
Instead, the swap information now show in file: /sys/block/zram<id>/mm_stat.

 

Comment 1 by vovoy@chromium.org, Jul 10 2017

Cc: bccheng@chromium.org nduca@chromium.org

Comment 2 by vovoy@chromium.org, Jul 11 2017

Cc: jamescook@chromium.org thestig@chromium.org davemoore@chromium.org
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 11 2017

Labels: Hotlist-Google
Cc: -davemoore@chromium.org
Feel free to send me a Chromium base/ CL to update GetSwapInfo() for review.

I see some boards have kernel 4.4. Has the zram /sys interface changed between kernel 3.18 and 4.4?
Description: Show this description
It seems like zRam still using same interfaces in kernel 4.4.
Cc: diand...@chromium.org semenzato@chromium.org sonnyrao@chromium.org
Argh, another place using the deprecated API?  Sigh.  Even though the main kernel 4.4 upstream doesn't have the change to remove the old sysfs locations, we've picked the change back to our 4.4 and 3.18 trees.

See  bug #739573  for another instance.
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/838f843b27320ab3bdf7011f52b148c8c2d734c8

commit 838f843b27320ab3bdf7011f52b148c8c2d734c8
Author: Chung-Sheng Wu <chungsheng@google.com>
Date: Fri Jul 21 04:17:58 2017

[CrOS]Fix GetSwapInfo to accommodate kernel zram api change.

ZRam has changed its sysfs interfaces since kernel version 3.18.
(https://github.com/torvalds/linux/commit/c87d1655c29500b459fb135258a93f8309ada9c7)
If file "/sys/block/zram0/mm_stat" exists, use the new interfaces,
otherwise, use the old one.

Bug= chromium:740438 

Change-Id: Ief192baeb76824e06c78744a1a5010b3d8d682fa
Reviewed-on: https://chromium-review.googlesource.com/566796
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Zhong-sheng Wu <chungsheng@google.com>
Cr-Commit-Position: refs/heads/master@{#488578}
[modify] https://crrev.com/838f843b27320ab3bdf7011f52b148c8c2d734c8/base/process/process_metrics.h
[modify] https://crrev.com/838f843b27320ab3bdf7011f52b148c8c2d734c8/base/process/process_metrics_linux.cc
[modify] https://crrev.com/838f843b27320ab3bdf7011f52b148c8c2d734c8/base/process/process_metrics_unittest.cc

Thanks for fixing?  How critical is this code?  We we need merge requests?
I think we are ok. It's mostly used for metrics, so unless whoever is interested in the compressed swap metric says it's critical, we can just call it a day.
Labels: M-62
Status: Fixed (was: Started)
Things that land on branch day are complicated, but I sorta assume this is probably M-62 then...
Project Member

Comment 12 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74f0a0e970f5282a8271ae2e189f6896b0c7c7b0

commit 74f0a0e970f5282a8271ae2e189f6896b0c7c7b0
Author: Chung-Sheng Wu <chungsheng@google.com>
Date: Tue Aug 01 07:17:02 2017

[CrOS]Fix GetSwapInfo function bug.

Use |base::Optional| in wrong way.
Get the value in |base::Optional| by calling |base::Optional::value()|.

Bug= chromium:740438 

Change-Id: Id1e58280fa1bf113248996665793d8fd364d1e53
Reviewed-on: https://chromium-review.googlesource.com/593713
Commit-Queue: Zhong-sheng Wu <chungsheng@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490896}
[modify] https://crrev.com/74f0a0e970f5282a8271ae2e189f6896b0c7c7b0/base/process/process_metrics_linux.cc

Sign in to add a comment