Re: [PATCH for-next 2/3] IB/hfi1: Prepare resource waits for dual leg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/27/2018 2:38 PM, Jason Gunthorpe wrote:
On Wed, Sep 26, 2018 at 10:26:54AM -0700, Dennis Dalessandro wrote:
  /**
   * iowait_sdma_drain() - wait for DMAs to drain
- *
   * @wait: iowait structure
   *
   * This will delay until the iowait sdmas have
@@ -215,7 +219,7 @@ static inline void iowait_sdma_inc(struct iowait *wait)
/**
   * iowait_sdma_add - add count to pending
- * @wait: iowait structure
+ * @wait: iowait_work structure
   */
  static inline void iowait_sdma_add(struct iowait *wait, int count)
  {
@@ -223,15 +227,6 @@ static inline void iowait_sdma_add(struct iowait *wait, int count)
  }
/**
- * iowait_sdma_dec - note sdma complete
- * @wait: iowait structure
- */
-static inline int iowait_sdma_dec(struct iowait *wait)
-{
-	return atomic_dec_and_test(&wait->sdma_busy);
-}
-
-/**
   * iowait_pio_drain() - wait for pios to drain
   *
   * @wait: iowait structure
@@ -252,9 +247,23 @@ static inline void iowait_pio_drain(struct iowait *wait)
   * @wait: iowait structure
   *
   */
-static inline int iowait_pio_pending(struct iowait *wait)
+static inline int iowait_pio_pending(struct iowait *w)
+{
+	return atomic_read(&w->pio_busy);
+}
+
+/**
+ * iowait_drain_wakeup() - trigger iowait_drain() waiter
+ * @wait: iowait structure
+ *
+ * This will trigger any waiters.
+ */
+static inline void iowait_drain_wakeup(struct iowait *w)
  {
-	return atomic_read(&wait->pio_busy);
+	wake_up(&w->wait_dma);
+	wake_up(&w->wait_pio);
+	if (w->sdma_drained)
+		w->sdma_drained(w);
  }

Why is there so much churn and code motion here that doesn't seem to
really change anything? This is bad practice, diffs should be reviewed
to remove unncessary hunks.

Like iowait_drain_wakeup was moved up a bit, iowait_sdma_dec was moved
down a bit, etc.

Just an oversight I'd say. Kaike is trying to merge and split and shuffle patches for the TID RDMA series to be more organized into logical pieces per your initial feedback.

-Denny



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux