1. 21 10月, 2008 6 次提交
    • J
      powerpc/spufs: Use kmalloc rather than kzalloc for switch log buffer · 837ef884
      Jeremy Kerr 提交于
      No need to zero the entire buffer, just the head and tail indices.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      837ef884
    • J
      powerpc/spufs: Don't spu_acquire_saved unnecessarily in regs read · f027faa2
      Jeremy Kerr 提交于
      With most file readers (eg cat, dd), reading a context's regs file will
      result in two reads: the first to read the data, and the second to
      return EOF. Because each read performs a spu_acquire_saved, we end up
      descheduling and re-scheduling the context twice.
      
      This change does a simple check to see if we'd return EOF before
      calling spu_acquire_saved(), saving the extra schedule operation.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      f027faa2
    • J
      powerpc/spufs: Don't require full buffer in switch_log read · 14f693ee
      Jeremy Kerr 提交于
      Currently, read() on the sputrace log will block until the read buffer
      is full. This makes it difficult to retrieve the end of the buffer, as
      the user will need to read with the right-sized buffer.
      
      In a similar method as 91553a1b5e0df006a3573a88d98ee7cd48a3818a, this
      change makes the switch_log return if there has already been data
      read.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      14f693ee
    • J
      powerpc/spufs: Use state_mutex for switch_log locking, and prevent multiple openers · f5ed0eb6
      Jeremy Kerr 提交于
      Currently, we use ctx->mapping_lock and ctx->switch_log->lock for the
      context switch log. The mapping lock only prevents concurrent open()s,
      so we require the switch_lock->lock for reads.
      
      Since writes to the switch log buffer occur on context switches, we're
      better off synchronising with the state_mutex, which is held during a
      switch. Since we're serialised througout the buffer reads and writes,
      we can use the state mutex to protect open and release too, and
      can now kfree() the log buffer on release. This allows us to perform
      the switch log notify without taking any extra locks.
      
      Because the buffer is only present while the file is open, we can use
      it to prevent multiple simultaneous openers.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      f5ed0eb6
    • J
      powerpc/spufs: sputrace: Don't block until the read buffer is full · e869446b
      Jeremy Kerr 提交于
      Currently, read() on the sputrace buffer will only return data when
      the user buffer is exhausted. This may mean that we never see the
      end of the event log, unless we read() with exactly the right-sized
      buffer.
      
      This change makes sputrace_read not block if we have data ready to
      return.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      e869446b
    • J
      powerpc/spufs: sputrace: Only enable logging on open(), prevent multiple openers · baf39927
      Jeremy Kerr 提交于
      Currently, sputrace will start logging to the event buffer before the
      log buffer has been open()ed. This results in a heap of "lost samples"
      warnings if the sputrace file hasn't yet been opened.
      
      Since the buffer is reset on open() anyway, there's no need to enable
      logging when no-one has opened the log.
      
      Because open clears the log, make it return EBUSY for mutliple open
      calls.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      baf39927
  2. 16 10月, 2008 4 次提交
  3. 15 10月, 2008 30 次提交