'binder: RLIMIT_NICE not set' when using binder from the ubuntu side

Bug #1202887 reported by Ricardo Salveti on 2013-07-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-grouper (Ubuntu)
Medium
Unassigned
linux-maguro (Ubuntu)
Medium
Unassigned
linux-mako (Ubuntu)
Medium
Unassigned
linux-manta (Ubuntu)
Medium
Unassigned

Bug Description

http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-saucy.git;a=blob;f=drivers/staging/android/binder.c;hb=refs/heads/mako#l516

"""
static void binder_set_nice(long nice)
{
 long min_nice;
 if (can_nice(current, nice)) {
  set_user_nice(current, nice);
  return;
 }
 min_nice = 20 - current->signal->rlim[RLIMIT_NICE].rlim_cur;
 binder_debug(BINDER_DEBUG_PRIORITY_CAP,
       "binder: %d: nice value %ld not allowed use "
       "%ld instead\n", current->pid, nice, min_nice);
 set_user_nice(current, min_nice);
 if (min_nice < 20)
  return;
 binder_user_error("binder: %d RLIMIT_NICE not set\n", current->pid);
}
"""

That happens because binder expects it to be able to change the nice value for the specific process, and fails when the process is started by Ubuntu, which has a default nice value of 0 (rlimit nice is set to 40 40 by default in android, via android's init).

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Some logs:
Jul 18 22:32:07 ubuntu-phablet kernel: [ 81.813598] binder: 1255: nice value 0 not allowed use 20 instead
Jul 18 22:32:07 ubuntu-phablet kernel: [ 81.813598] binder: 1255 RLIMIT_NICE not set
Jul 18 22:32:07 ubuntu-phablet kernel: [ 81.881927] binder: 1262: nice value -8 not allowed use 20 instead
Jul 18 22:32:07 ubuntu-phablet kernel: [ 81.881927] binder: 1262 RLIMIT_NICE not set

To reproduce:
- Stop unity8 (stop unity8)
- Start the camera-app as phablet user:
/usr/bin/camera-app -testability --fullscreen --desktop_file_hint=/usr/share/applications/camera-app.desktop

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

The camera app uses binder to talk to the media service, which is running inside the Android container.

tags: added: kernel-da-key saucy
Changed in linux-grouper (Ubuntu):
importance: Undecided → Medium
Changed in linux-maguro (Ubuntu):
importance: Undecided → Medium
Changed in linux-mako (Ubuntu):
importance: Undecided → Medium
Changed in linux-manta (Ubuntu):
importance: Undecided → Medium
Changed in touch-preview-images:
importance: Undecided → Medium
Revision history for this message
Tim Gardner (timg-tpi) wrote :

Ricardo - Andy and I don't think this is a bug. The container appears to be doing what it is designed to do, e.g., contain processes within their assigned limits. IIRC you've already written an upstart job that launches the binder with appropriate 'nice' limits, right ?

Revision history for this message
anders3408 (anders3408) wrote :

same thing happens on oppo find 5 builds...

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

From camera-app:
Max nice priority 0 0
Max realtime priority 0 0

We're not setting the nice value as done by android since we flipped the container, and afaik we still don't have a policy that describes the nice priority for specific processes (system, phablet, etc).

The binder message itself is harmless, and we're ignoring it at syslog already, just annoying the kernel log buffer ring.

Bill Filler (bfiller) on 2014-07-01
no longer affects: touch-preview-images
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers