The curtain air bags are mounted in the front and rear window pillars, and the roof edge along both sides.
When the air bag crash sensors detect a side impact of greater than moderate force, the curtain air bag inflates quickly and helps to reduce injury mainly to the rear outboard passenger's head caused by directly hitting interior parts such as a door or window. For more details about air bag deployment, refer to "SRS Air Bag Deployment Criteria".
In a side impact:
Greater than moderate impact to one side of the vehicle will cause the curtain air bag on that side only to inflate.

(With Front Passenger Occupant Classification System) In a roll-over:
In response to a vehicle roll-over, both curtain air bags inflate.

Warning Light/Beep
A system malfunction or operation conditions are indicated by a warning.Refer to Warning/Indicator Lights. Refer to Warning Sound is Activated.
Side Air Bags
SRS Air Bag Deployment CriteriaMazda 6 Owners Manual: Door switch removal/installation
Front
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal.
Rear
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal. ...
Mazda 6 Owners Manual: Locking, Unlocking the Doors
NOTE
The system may not operate if you are too close to the windows or door
handles.
If the key is left in the following areas and you leave the vehicle,
the doors may be locked depending on the radio wave conditions even if the key
is left in the vehicle.
Around the dashboard
...