Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752489AbbBRPJT (ORCPT ); Wed, 18 Feb 2015 10:09:19 -0500 Received: from mail-qg0-f43.google.com ([209.85.192.43]:46216 "EHLO mail-qg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbbBRPJS (ORCPT ); Wed, 18 Feb 2015 10:09:18 -0500 MIME-Version: 1.0 Date: Wed, 18 Feb 2015 20:39:17 +0530 Message-ID: Subject: Clarification needed regarding memory barrier From: Ayyappa Ch To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 48 Hello All, I am reading memory-barrier.txt file as mentioned below. Please clarify my doubt . 1) For example if CPU1 got the lock , How PCI bridge can see STORE *ADDR = 4 before STORE *DATA = 1? ACQUIRES VS I/O ACCESSES ------------------------ Under certain circumstances (especially involving NUMA), I/O accesses within two spinlocked sections on two different CPUs may be seen as interleaved by the PCI bridge, because the PCI bridge does not necessarily participate in the cache-coherence protocol, and is therefore incapable of issuing the required read memory barriers. For example: CPU 1 =============================== spin_lock(Q) writel(0, ADDR) writel(1, DATA); spin_unlock(Q); CPU 2 =============================== spin_lock(Q); writel(4, ADDR); writel(5, DATA); spin_unlock(Q); may be seen by the PCI bridge as follows: STORE *ADDR = 0, STORE *ADDR = 4, STORE *DATA = 1, STORE *DATA = 5 which would probably cause the hardware to malfunction. Thanks and regards, Ayyappa.Ch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/