lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 11 May 2007 00:32:02 +0530 (IST)
From:	Satyam Sharma <ssatyam@....iitk.ac.in>
To:	linux-kernel@...r.kernel.org
cc:	akpm@...ux-foundation.org, mingo@...e.hu, sripathik@...ibm.com
Subject: [PATCH -mm 2/2] Reintroduce write_trylock_irqsave()

Reintroduce the new write_trylock_irqsave() implementation: slightly faster,
less invasive and similar in style to the implementation of
spin_trylock_irqsave() in mainline and -mm.

Signed-off-by: Satyam Sharma <ssatyam@....iitk.ac.in>
Cc: Sripathi Kodi <sripathik@...ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>

---

  include/linux/spinlock.h |    7 +++++++
  1 file changed, 7 insertions(+)

---

diff -ruNp a/include/linux/spinlock.h b/include/linux/spinlock.h
--- a/include/linux/spinlock.h	2007-05-11 00:25:34.000000000 +0530
+++ b/include/linux/spinlock.h	2007-05-11 00:27:35.000000000 +0530
@@ -282,6 +282,13 @@ do {						\
  	1 : ({ local_irq_restore(flags); 0; }); \
  })

+#define write_trylock_irqsave(lock, flags) \
+({ \
+	local_irq_save(flags); \
+	write_trylock(lock) ? \
+	1 : ({ local_irq_restore(flags); 0; }); \
+})
+
  /*
   * Locks two spinlocks l1 and l2.
   * l1_first indicates if spinlock l1 should be taken first.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ