Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8373717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:44:59+00:00 2026-06-09T14:44:59+00:00

I am trying to debug a kernel code, because of a scheduling while in

  • 0

I am trying to debug a kernel code, because of a “scheduling while in atomic” that is crashing my system. In some point of an actual kernel module I added a line for calling a function defined in another kernel module (this one made by me). The call is:

mycallback(svc, skb);

And mycallback() function returns int. So I have 2 questions:

  1. Is it safe to call a non-void function inside the kernel without asigning its result to a variable?

  2. If the code where mycallback() is called would be spin_locked or something like that, would it be safe? Would it be spin_locked/atomic or I might sleep and compromise the kernel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:45:01+00:00Added an answer on June 9, 2026 at 2:45 pm

    Is it safe to call a non-void function inside the kernel without
    asigning its result to a variable?

    Yes.

    If the code where mycallback() is called would be spin_locked or
    something like that, would it be safe? Would it be spin_locked/atomic
    or I might sleep and compromise the kernel?

    If the code that calls mycallback() can hold a spinlock, mycallback() must not call any functions that can sleep. If you do try to sleep while holding a spinlock, you will see the “Scheduling while atomic” crash that you’ve described.

    Potentially sleeping functions include copy_to_user(), copy_from_user(), kmalloc() (without the GFP_ATOMIC flag), mutex_lock() and a lot more beside.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to debug kernel module. I suspect to have there some memory leaks.
I'm trying to debug a problem with some legacy code. While trying to understand
Im trying to debug a nagios plugin (check_aacraid.py) that uses NRPE. The system in
I am trying to debug some code and get to the bottom of the
Trying to debug some ajax calls not working properly in IE, i noticed that
I am having real problems trying debug my code to malfunctioning print statements. I
I'm trying to debug a web page that makes heavy use of events, and
I am trying to compile a code that has a malloc function inside the
I am trying to update a kernel driver for Android, I have added some
I have a buggy kernel module which I am trying to fix. Basically when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.