Project

General

Profile

Actions

Bug #11927

closed

Log, or optionally panic, on zero-length kmem allocations

Added by Dan McDonald over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Joyent bug OS-4297 implements a tracking of zero-length kmem allocations in the kernel. We generally want to discourage these.

Additional fixes to that are needed, and are filed-but-not-fixed as Joyent bug OS-8018. This upstream-it bug should contain both.


Related issues

Related to illumos gate - Bug #11928: rpcmod's clnt_cots can do zero-length kmem allocationsClosedDan McDonald

Actions
Actions #1

Updated by Marcel Telka over 2 years ago

  • Related to Bug #11928: rpcmod's clnt_cots can do zero-length kmem allocations added
Actions #2

Updated by Marcel Telka over 2 years ago

From the kmem_alloc(9f) man page:

NOTES
       kmem_alloc(0, flag) always returns NULL.  kmem_free(NULL, 0) is legal.
Actions #3

Updated by Dan McDonald over 2 years ago

This is actually three SmartOS bugs, OS-4194 (initial change with cleanups), OS-8018 (not yet fixed), AND OS-4297 (reduction to log-only in DEBUG by default, vs. panic).

These fixes have been in SmartOS since August of 2015.

commit 92d00144d1e2f01ebc15a0099c0a06a8210c7ccb
Author: Bryan Cantrill <>
AuthorDate: Fri Jul 31 07:14:02 2015 +0000
Commit: Bryan Cantrill <>
CommitDate: Fri Jul 31 07:14:02 2015 +0000

OS-4297 zero-sized allocations should be logged but not warned about
Actions #4

Updated by Dan McDonald over 2 years ago

Additionally, this code was additionally tested by the DEBUG smoke-testing of nfs-zone. Apart from fixes in #11928, there were no other zero-allocation noises (because of the accompanying fixes in kernel code in this wad).

Actions #5

Updated by Electric Monk over 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit d15801816cc716b56ada92df72ee04b7b891291c

commit  d15801816cc716b56ada92df72ee04b7b891291c
Author: Bryan Cantrill <bryan@joyent.com>
Date:   2019-11-21T15:57:15.000Z

    11927 Log, or optionally panic, on zero-length kmem allocations
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF