1. 12 Mar, 2021 1 commit
    • Beata Michalska's avatar
      opp: Don't drop extra references to OPPs accidentally · 606a5d42
      Beata Michalska authored
      We are required to call dev_pm_opp_put() from outside of the
      opp_table->lock as debugfs removal needs to happen lock-less to avoid
      circular dependency issues.
      
      commit cf1fac94 ("opp: Reduce the size of critical section in
      _opp_kref_release()") tried to fix that introducing a new routine
      _opp_get_next() which keeps returning OPPs that can be freed by the
      callers and this routine shall be called without holding the
      opp_table->lock.
      
      Though the commit overlooked the fact that the OPPs can be referenced by
      other users as well and this routine will end up dropping references
      which were taken by other users and hence freeing the OPPs prematurely.
      
      In effect, other users of the OPPs will end up having invalid pointers
      at hand. We didn't see any crash reports earlier as the exact situation
      never happened, though it is certainly possible.
      
      We need a way to mark which OPPs are no longer referenced by the OPP
      core, so we don't drop extra references to them accidentally.
      
      This commit adds another OPP flag, "removed", which is used to track
      this. And now we should never end up dropping extra references to the
      OPPs.
      
      Cc: v5.11+ <stable@vger.kernel.org> # v5.11+
      Fixes: cf1fac94 ("opp: Reduce the size of critical section in _opp_kref_release()")
      Signed-off-by: default avatarBeata Michalska <beata.michalska@arm.com>
      [ Viresh: Almost rewrote entire patch, added new "removed" field,
      	  rewrote commit log and added the correct Fixes tag. ]
      Co-developed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      606a5d42
  2. 06 Mar, 2021 4 commits
  3. 05 Mar, 2021 33 commits
  4. 04 Mar, 2021 2 commits
    • Jens Axboe's avatar
      kernel: provide create_io_thread() helper · cc440e87
      Jens Axboe authored
      Provide a generic helper for setting up an io_uring worker. Returns a
      task_struct so that the caller can do whatever setup is needed, then call
      wake_up_new_task() to kick it into gear.
      
      Add a kernel_clone_args member, io_thread, which tells copy_process() to
      mark the task with PF_IO_WORKER.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      cc440e87
    • Pavel Begunkov's avatar
      io_uring: reliably cancel linked timeouts · dd59a3d5
      Pavel Begunkov authored
      Linked timeouts are fired asynchronously (i.e. soft-irq), and use
      generic cancellation paths to do its stuff, including poking into io-wq.
      The problem is that it's racy to access tctx->io_wq, as
      io_uring_task_cancel() and others may be happening at this exact moment.
      Mark linked timeouts with REQ_F_INLIFGHT for now, making sure there are
      no timeouts before io-wq destraction.
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      dd59a3d5