Skip to content
Snippets Groups Projects
  1. Mar 01, 2023
    • Linus Torvalds's avatar
      capability: just use a 'u64' instead of a 'u32[2]' array · f122a08b
      Linus Torvalds authored
      
      Back in 2008 we extended the capability bits from 32 to 64, and we did
      it by extending the single 32-bit capability word from one word to an
      array of two words.  It was then obfuscated by hiding the "2" behind two
      macro expansions, with the reasoning being that maybe it gets extended
      further some day.
      
      That reasoning may have been valid at the time, but the last thing we
      want to do is to extend the capability set any more.  And the array of
      values not only causes source code oddities (with loops to deal with
      it), but also results in worse code generation.  It's a lose-lose
      situation.
      
      So just change the 'u32[2]' into a 'u64' and be done with it.
      
      We still have to deal with the fact that the user space interface is
      designed around an array of these 32-bit values, but that was the case
      before too, since the array layouts were different (ie user space
      doesn't use an array of 32-bit values for individual capability masks,
      but an array of 32-bit slices of multiple masks).
      
      So that marshalling of data is actually simplified too, even if it does
      remain somewhat obscure and odd.
      
      This was all triggered by my reaction to the new "cap_isidentical()"
      introduced recently.  By just using a saner data structure, it went from
      
      	unsigned __capi;
      	CAP_FOR_EACH_U32(__capi) {
      		if (a.cap[__capi] != b.cap[__capi])
      			return false;
      	}
      	return true;
      
      to just being
      
      	return a.val == b.val;
      
      instead.  Which is rather more obvious both to humans and to compilers.
      
      Cc: Mateusz Guzik <mjguzik@gmail.com>
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Cc: Serge Hallyn <serge@hallyn.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Paul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f122a08b
    • Jens Axboe's avatar
      io_uring/poll: don't pass in wake func to io_init_poll_iocb() · 1947ddf9
      Jens Axboe authored
      
      We only use one, and it's io_poll_wake(). Hardwire that in the initial
      init, as well as in __io_queue_proc() if we're setting up for double
      poll.
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1947ddf9
  2. Feb 28, 2023
  3. Feb 26, 2023
    • Jens Axboe's avatar
      io_uring/poll: allow some retries for poll triggering spuriously · c16bda37
      Jens Axboe authored
      If we get woken spuriously when polling and fail the operation with
      -EAGAIN again, then we generally only allow polling again if data
      had been transferred at some point. This is indicated with
      REQ_F_PARTIAL_IO. However, if the spurious poll triggers when the socket
      was originally empty, then we haven't transferred data yet and we will
      fail the poll re-arm. This either punts the socket to io-wq if it's
      blocking, or it fails the request with -EAGAIN if not. Neither condition
      is desirable, as the former will slow things down, while the latter
      will make the application confused.
      
      We want to ensure that a repeated poll trigger doesn't lead to infinite
      work making no progress, that's what the REQ_F_PARTIAL_IO check was
      for. But it doesn't protect against a loop post the first receive, and
      it's unnecessarily strict if we started out with an empty socket.
      
      Add a somewhat random retry count, just to put an upper limit on the
      potential number of retries that will be done. This should be high enough
      that we won't really hit it in practice, unless something needs to be
      aborted anyway.
      
      Cc: stable@vger.kernel.org # v5.10+
      Link: https://github.com/axboe/liburing/issues/364
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c16bda37
  4. Feb 24, 2023
  5. Feb 22, 2023
  6. Feb 16, 2023
  7. Feb 11, 2023
  8. Feb 06, 2023
  9. Feb 03, 2023
  10. Jan 29, 2023
Loading