Mahrez doubled the lead for Algeria in the 61st minute.
The Egyptian king, Mohamed Salah, on Monday helped his national team subdue stubborn Zimbabwe.
After a wasteful first half with both teams missing several chances to break the deadlock, Barnes opened the scoring for the hosts in the 63rd minute.
Ismaila Sarr put Crystal Palace ahead in the 41st minute.
The Gunners secured three points to top the league table.
Both teams went into the break without scoring. But Leandro Trossard broke the deadlock for Arsenal in the second half.
Manchester City struck first just nine minutes into the first half with a goal from Erling Haaland.
Real Madrid hosted French side Olympique Marseille, with Xabi Alonso avoiding a debut defeat thanks to Kylian Mbappé.
With 15 minutes left, City launched a sharp counterattack, but Dutch midfielder Tijjani Reijnders failed to convert, missing a chance to put his side four goals up.
Spurs maintained their unbeaten start under manager Thomas Frank following an opening 3-0 win over Burnley.
