I took it upon myself to rewatch the first half of Cardiff (I still can't stomach watching the second half of that game). These were our key weaknesses relative to Madrid, IMO:
1. Midfield
Khedira is not athletic and he's not technically gifted. He's a bit of a passenger in games of this quality to be honest. We were never going to win with a double pivot with Khedira and Pjanic against Kroos-Isco-Modric-Casemiro. Our best bet if we took on Madrid again would be to play a midfield trio of Matuidi, Marchisio and Pjanic. Matuidi has the grinta to compete with Casemiro, and Marchisio is much better technically than Khedira. If only he could stay fit.
2. Wide Areas
Mandzukic scored an amazing goal, but in the game overall, we lacked an outlet from the wings. Sandro was typically our biggest threat on the left, putting the most crosses into the box. Now Sandro is good going forward but he's no Marcelo. Mandzukic should be at the end of the crosses into the box instead of being the crosser. We should have Costa on the wing. Carvajal struggled with Rashford, Costa's speed and trickery would give him nightmares.
If we play Madrid again this season, how do we line-up?
Mandzukic
Costa - Dybala
Matuidi - Marchisio - Pjanic
Sandro - Chiellini - Rugani - MDS
Buffon
would be our best bet. We can't let Real dominate the middle of the park again, and we need a speedy outlet to counterattack. At Cardiff, Real was not afraid of our counter at all. That's probably because both Mandzukic and Higuain are very static and predictable.